blob: de232a6d6b0cd8902836cc7ad79313410580cd57 [file] [log] [blame]
Alexander Afanasyev151a8552014-04-11 00:54:43 -07001ndnsec-export
2=============
3
Davide Pesaventob310efb2019-04-11 22:10:24 -04004Synopsis
5--------
Alexander Afanasyev151a8552014-04-11 00:54:43 -07006
Junxiao Shibc2e78e2020-05-20 15:01:08 -06007**ndnsec-export** [**-h**] [**-o** *file*] [**-P** *passphrase*]
8[**-i**\|\ **-k**\|\ **-c**] *name*
Alexander Afanasyev151a8552014-04-11 00:54:43 -07009
10Description
11-----------
12
Junxiao Shibc2e78e2020-05-20 15:01:08 -060013:program:`ndnsec-export` exports a certificate from the **Public Info Base (PIB)** and
14its private key to a file. It will ask for a passphrase to encrypt the private key.
Davide Pesaventob310efb2019-04-11 22:10:24 -040015The resulting file can be imported again using :program:`ndnsec-import`.
Alexander Afanasyev151a8552014-04-11 00:54:43 -070016
17Options
18-------
19
Junxiao Shibc2e78e2020-05-20 15:01:08 -060020.. option:: -i, --identity
21
22 Interpret *name* as an identity name. The default certificate of the identity will be exported.
23 This is the default unless **-k** or **-c** is specified.
24
25.. option:: -k, --key
26
27 Interpret *name* as a key name. The default certificate of the key will be exported.
28
29.. option:: -c, --cert
30
31 Interpret *name* as a certificate name.
32
Davide Pesaventob310efb2019-04-11 22:10:24 -040033.. option:: -o <file>, --output <file>
Alexander Afanasyev151a8552014-04-11 00:54:43 -070034
Davide Pesaventob310efb2019-04-11 22:10:24 -040035 Write to the specified output file instead of the standard output.
Junxiao Shi476200b2017-10-05 12:16:27 +000036
Davide Pesaventob310efb2019-04-11 22:10:24 -040037.. option:: -P <passphrase>, --password <passphrase>
Alexander Afanasyev634a62b2018-06-15 16:55:26 -040038
Davide Pesaventob310efb2019-04-11 22:10:24 -040039 Passphrase to use for the export. If empty or not specified, the user is
40 interactively asked to type the passphrase on the terminal. Note that
41 specifying the passphrase via this option is insecure, as it can potentially
42 end up in the shell's history, be visible in :command:`ps` output, and so on.
Alexander Afanasyev151a8552014-04-11 00:54:43 -070043
Davide Pesaventob310efb2019-04-11 22:10:24 -040044Example
45-------
Alexander Afanasyev151a8552014-04-11 00:54:43 -070046
Davide Pesaventob310efb2019-04-11 22:10:24 -040047Export an identity's default certificate and private key into a file::
Alexander Afanasyev151a8552014-04-11 00:54:43 -070048
Junxiao Shi476200b2017-10-05 12:16:27 +000049 $ ndnsec-export -o alice.ndnkey /ndn/test/alice
Alexander Afanasyev151a8552014-04-11 00:54:43 -070050
Junxiao Shibc2e78e2020-05-20 15:01:08 -060051Export a specific certificate and its private key to the standard output::
Alexander Afanasyev151a8552014-04-11 00:54:43 -070052
Junxiao Shibc2e78e2020-05-20 15:01:08 -060053 $ ndnsec-export -c /ndn/edu/ucla/alice/KEY/1%5D%A7g%90%B2%CF%AA/self/%FD%00%00%01r-%D3%DC%2A