blob: 2df5237878ddfd98c75cc674547e5ff4542811f6 [file] [log] [blame]
Alexander Afanasyev151a8552014-04-11 00:54:43 -07001ndnsec-key-gen
2==============
3
Davide Pesaventob310efb2019-04-11 22:10:24 -04004Synopsis
5--------
Alexander Afanasyev151a8552014-04-11 00:54:43 -07006
Zhiyi Zhang4c68b6e2020-04-20 16:13:21 -07007**ndnsec-key-gen** [**-h**] [**-n**] [**-t** *type*]
8[**-k** *keyidtype*\|\ **--keyid** *keyid*] *identity*
Alexander Afanasyev151a8552014-04-11 00:54:43 -07009
10Description
11-----------
12
Davide Pesaventob310efb2019-04-11 22:10:24 -040013:program:`ndnsec-key-gen` generates a key pair for the specified *identity* and
14sets the generated public key as the identity's default key.
15:program:`ndnsec-key-gen` will also create a signing request for the generated key.
16The signing request will be written to the standard output in base64 encoding.
Alexander Afanasyev151a8552014-04-11 00:54:43 -070017
Davide Pesaventob310efb2019-04-11 22:10:24 -040018By default, it will also set the identity as the user's default identity.
Alexander Afanasyev151a8552014-04-11 00:54:43 -070019
20Options
21-------
22
Davide Pesaventob310efb2019-04-11 22:10:24 -040023.. option:: -n, --not-default
Alexander Afanasyev151a8552014-04-11 00:54:43 -070024
Davide Pesaventob310efb2019-04-11 22:10:24 -040025 Do not set the identity as the user's default identity.
Alexander Afanasyev2a047eb2014-11-30 22:45:02 -080026
Davide Pesaventob310efb2019-04-11 22:10:24 -040027 Note that if no other identity/key/certificate exists, then the identity
28 will become the default regardless of this option.
Yingdi Yu7d8644a2014-12-01 22:55:49 -080029
Davide Pesaventob310efb2019-04-11 22:10:24 -040030.. option:: -t <type>, --type <type>
31
Davide Pesavento702467b2020-04-22 21:41:23 -040032 Type of key to generate. "r" for RSA, "e" for ECDSA (the default).
Davide Pesaventob310efb2019-04-11 22:10:24 -040033
34.. option:: -k <keyidtype>, --keyid-type <keyidtype>
35
Zhiyi Zhang4c68b6e2020-04-20 16:13:21 -070036 Type of KeyId for the generated key. "r" for a 64-bit random number (the default
37 unless **--keyid** is specified), "h" for the SHA-256 of the public key.
38
39.. option:: --keyid <keyid>
40
41 User-specified KeyId. Must be a non-empty generic name component.
Davide Pesaventob310efb2019-04-11 22:10:24 -040042
43Example
44-------
Alexander Afanasyev151a8552014-04-11 00:54:43 -070045
46::
47
48 $ ndnsec-key-gen /ndn/test/david
49 Bv0DAAc9CANuZG4IBHRlc3QIBWRhdmlkCANLRVkIEWtzay0xMzk2OTEzMDU4MTk2
50 CAdJRC1DRVJUCAgAAAFFPoG0ohQDGAECFf0BeDCCAXQwIhgPMjAxNDA0MDcyMzI0
51 MThaGA8yMDM0MDQwMjIzMjQxOFowKjAoBgNVBCkTIS9uZG4vdGVzdC9kYXZpZC9r
52 c2stMTM5NjkxMzA1ODE5NjCCASAwDQYJKoZIhvcNAQEBBQADggENADCCAQgCggEB
53 ALS6udLacpydecxMRIfZeo74fxzpsITqaa/4UxD2FJ9lU4dtfiSSIOaRwAB/w0K/
54 AauQRq3Q1AiEocUsW2h8LmtcuF4Cj9TGAUD/1s3CISMwf9zwQ3ZhNIzN0IOsrpPA
55 TsHrbdwtOxrcFvXX4GnMLWgtvcSB52Cn68h/4AUiA1CG9/DOyCyA4EHiIkHBxh6B
56 TvAmw7SmNjr1ZBTYMaMAEV5/oLZCHzHRO+2fKdEttaWH3bz7iKVVS8u5ZxXcBs8g
57 ot55m7Xf6/TUk3qQXM1kM8wW04U+8n3jch1i7tD2T3c/OFKTT7AWndwcfbU99Z6C
58 FZ7fMsgRHxFNY8hCFZJvFFUCAREWOhsBARw1BzMIA25kbggEdGVzdAgFZGF2aWQI
59 A0tFWQgRa3NrLTEzOTY5MTMwNTgxOTYIB0lELUNFUlQX/QEAW2yfF8JTgu5okR+n
60 dRlXc3UR/b1REegrpQb3xVzs7fYiiHwFYzQE9RzOuGh/9GSMvQcfejsPw021tJnj
61 oxNx6spGTOK5Bc0QZGeC6YyNoVSaJr9Obc5Uh8eRqxw76r0pCUHP+l38UgUGeBg/
62 aHurtcu5zK0zFYX++SAfUGLUZlG4CqKBUNZC+6w9OGUXlcW411zMzfqQ7V9Gxg+p
63 1IMNJQ6trTFdIwT/4YWHsxR+16r2TRWCNHtJey2GEG84YoqRh8y37jnu7oPhAtTN
64 TgG9O7O39dZLiFg+UP3LpW1LY64fJXsNfZQmnZWcNo5lX6MXfeiPxWFjOQqnno82
65 1hgqgA==