blob: 2acab6ee62d0dbcfc0bfcced13bd7a6ad86c4136 [file] [log] [blame]
Alexander Afanasyev151a8552014-04-11 00:54:43 -07001ndnsec-cert-dump
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 cert-dump** [**-h**] [**-p**] [**-r** [**-H** *host*] [**-P** *port*]]
Davide Pesaventob310efb2019-04-11 22:10:24 -04008[**-i**\|\ **-k**\|\ **-f**] *name*
Alexander Afanasyev151a8552014-04-11 00:54:43 -07009
10Description
11-----------
12
Davide Pesavento102f0572024-06-22 15:00:06 -040013This command reads an NDN certificate, either from the **Public Information Base (PIB)**
14or from the specified file, and prints it on the standard output, either in Base64 encoding
15or in a human-readable format.
Alexander Afanasyev151a8552014-04-11 00:54:43 -070016
Davide Pesaventob310efb2019-04-11 22:10:24 -040017By default, *name* is interpreted as a certificate name.
Alexander Afanasyev151a8552014-04-11 00:54:43 -070018
19Options
20-------
21
Davide Pesaventob310efb2019-04-11 22:10:24 -040022.. option:: -i, --identity
Alexander Afanasyev151a8552014-04-11 00:54:43 -070023
Davide Pesaventob310efb2019-04-11 22:10:24 -040024 Interpret *name* as an identity name. If specified, the certificate to dump
25 is the default certificate of the identity.
Alexander Afanasyev151a8552014-04-11 00:54:43 -070026
Davide Pesaventob310efb2019-04-11 22:10:24 -040027.. option:: -k, --key
Alexander Afanasyev151a8552014-04-11 00:54:43 -070028
Davide Pesaventob310efb2019-04-11 22:10:24 -040029 Interpret *name* as a key name. If specified, the certificate to dump is the
30 default certificate of the key.
Alexander Afanasyev151a8552014-04-11 00:54:43 -070031
Davide Pesaventob310efb2019-04-11 22:10:24 -040032.. option:: -f, --file
Alexander Afanasyev151a8552014-04-11 00:54:43 -070033
Davide Pesaventob310efb2019-04-11 22:10:24 -040034 Interpret *name* as a path to a file containing the certificate. If *name*
35 is "-", the certificate will be read from the standard input.
36
37.. option:: -p, --pretty
38
39 Print the certificate in a human-readable format.
40
Davide Pesavento102f0572024-06-22 15:00:06 -040041Examples
42--------
Davide Pesaventob310efb2019-04-11 22:10:24 -040043
Davide Pesavento102f0572024-06-22 15:00:06 -040044Export a certificate from the local PIB to the standard output with Base64 encoding::
Alexander Afanasyev151a8552014-04-11 00:54:43 -070045
Davide Pesavento102f0572024-06-22 15:00:06 -040046 $ ndnsec cert-dump /ndn/test/david/KEY/%7FE%1C%18%D2%03%BD%3F/self/v=1719080300644
47 Bv0BOAcxCANuZG4IBHRlc3QIBWRhdmlkCANLRVkICH9FHBjSA70/CARzZWxmNggA
48 AAGQQSuwZBQJGAECGQQANu6AFVswWTATBgcqhkjOPQIBBggqhkjOPQMBBwNCAAQ8
49 7QbdgubF3IznydpZ8PuppHgVRufGsUMDvHpS8Rw93rAAsw+8aVcNmw94wzpALWzD
50 3femcs+qHaWoIOBOn26SFlIbAQMcIwchCANuZG4IBHRlc3QIBWRhdmlkCANLRVkI
51 CH9FHBjSA70//QD9Jv0A/g8yMDI0MDYyMlQxODE4MjD9AP8PMjA0NDA2MTdUMTgx
52 ODIwF0cwRQIhAPqG+GtIQlbcgB9ZFAGCKcO7DBMK+K3RinEAbzqKpFTcAiAp+D8L
53 z/S6nPNtSTGBBxr4cdUecjIHxKN6DoP3K1o2yg==
Alexander Afanasyev151a8552014-04-11 00:54:43 -070054
Davide Pesaventodd0724b2022-04-18 00:30:05 -040055Print the NDN testbed root certificate in human-readable format::
Alexander Afanasyev151a8552014-04-11 00:54:43 -070056
Davide Pesavento102f0572024-06-22 15:00:06 -040057 $ curl -A ndnsec -fsLS https://named-data.net/ndnsec/ndn-testbed-root.ndncert.x3.base64 | ndnsec cert-dump -fp -
Davide Pesaventodd0724b2022-04-18 00:30:05 -040058 Certificate Name:
59 /ndn/KEY/%EC%F1L%8EQ%23%15%E0/ndn/%FD%00%00%01u%E6%7F2%10
60 Additional Description:
61 fullname: NDN Testbed Root X3
62 Public Key:
63 Key Type: 256-bit EC
64 MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEGx+3Y4FvYo1eScIvgD74lQhQdzN4
65 zq021dop8t7kGfEpfGdKf2HGpnn4/qoF9iJ1yUZE/7Na8zzO4xT6RpIM0Q==
Alexander Afanasyev151a8552014-04-11 00:54:43 -070066 Validity:
Davide Pesaventodd0724b2022-04-18 00:30:05 -040067 Not Before: 2020-11-20T16:31:37
68 Not After: 2024-12-31T23:59:59
69 Signature Information:
70 Signature Type: SignatureSha256WithEcdsa
71 Key Locator: Name=/ndn/KEY/%EC%F1L%8EQ%23%15%E0
72 Self-Signed: yes
Davide Pesavento102f0572024-06-22 15:00:06 -040073
74See Also
75--------
76
77:manpage:`ndnsec-cert-install(1)`,
78:manpage:`ndnsec-export(1)`