blob: 86b62d023558835f5191fba420a089bdef6038a2 [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
Davide Pesavento102f0572024-06-22 15:00:06 -04007**ndnsec export** [**-h**] [**-o** *file*] [**-P** *passphrase*]
Junxiao Shibc2e78e2020-05-20 15:01:08 -06008[**-i**\|\ **-k**\|\ **-c**] *name*
Alexander Afanasyev151a8552014-04-11 00:54:43 -07009
10Description
11-----------
12
Davide Pesavento102f0572024-06-22 15:00:06 -040013Export a certificate from the local **Public Information Base (PIB)** and its private key to
14a file in **SafeBag** format.
15The command will interactively ask for a passphrase to be used for encrypting the private key.
16
17The resulting file can be later imported using :program:`ndnsec-import`.
Alexander Afanasyev151a8552014-04-11 00:54:43 -070018
19Options
20-------
21
Junxiao Shibc2e78e2020-05-20 15:01:08 -060022.. option:: -i, --identity
23
Davide Pesavento102f0572024-06-22 15:00:06 -040024 Interpret *name* as an identity name.
25 The default certificate of the identity will be exported.
26 This is the default unless :option:`-k` or :option:`-c` is specified.
Junxiao Shibc2e78e2020-05-20 15:01:08 -060027
28.. option:: -k, --key
29
Davide Pesavento102f0572024-06-22 15:00:06 -040030 Interpret *name* as a key name.
31 The default certificate of the key will be exported.
Junxiao Shibc2e78e2020-05-20 15:01:08 -060032
33.. option:: -c, --cert
34
35 Interpret *name* as a certificate name.
36
Davide Pesaventob310efb2019-04-11 22:10:24 -040037.. option:: -o <file>, --output <file>
Alexander Afanasyev151a8552014-04-11 00:54:43 -070038
Davide Pesaventob310efb2019-04-11 22:10:24 -040039 Write to the specified output file instead of the standard output.
Junxiao Shi476200b2017-10-05 12:16:27 +000040
Davide Pesaventob310efb2019-04-11 22:10:24 -040041.. option:: -P <passphrase>, --password <passphrase>
Alexander Afanasyev634a62b2018-06-15 16:55:26 -040042
Davide Pesavento102f0572024-06-22 15:00:06 -040043 Passphrase to use for encryption. If empty or not specified, the user is
Davide Pesaventob310efb2019-04-11 22:10:24 -040044 interactively asked to type the passphrase on the terminal. Note that
45 specifying the passphrase via this option is insecure, as it can potentially
46 end up in the shell's history, be visible in :command:`ps` output, and so on.
Alexander Afanasyev151a8552014-04-11 00:54:43 -070047
Davide Pesavento102f0572024-06-22 15:00:06 -040048Examples
49--------
Alexander Afanasyev151a8552014-04-11 00:54:43 -070050
Davide Pesavento102f0572024-06-22 15:00:06 -040051Export an identity's default certificate and private key to a file::
Alexander Afanasyev151a8552014-04-11 00:54:43 -070052
Davide Pesavento102f0572024-06-22 15:00:06 -040053 $ ndnsec export -o alice.ndnkey /ndn/test/alice
Alexander Afanasyev151a8552014-04-11 00:54:43 -070054
Junxiao Shibc2e78e2020-05-20 15:01:08 -060055Export a specific certificate and its private key to the standard output::
Alexander Afanasyev151a8552014-04-11 00:54:43 -070056
Davide Pesavento102f0572024-06-22 15:00:06 -040057 $ ndnsec export -c /ndn/edu/ucla/alice/KEY/1%5D%A7g%90%B2%CF%AA/self/%FD%00%00%01r-%D3%DC%2A
58
59See Also
60--------
61
62:manpage:`ndnsec-cert-dump(1)`,
63:manpage:`ndnsec-import(1)`