Alexander Afanasyev | 151a855 | 2014-04-11 00:54:43 -0700 | [diff] [blame] | 1 | ndnsec-key-gen |
| 2 | ============== |
| 3 | |
Davide Pesavento | b310efb | 2019-04-11 22:10:24 -0400 | [diff] [blame] | 4 | Synopsis |
| 5 | -------- |
Alexander Afanasyev | 151a855 | 2014-04-11 00:54:43 -0700 | [diff] [blame] | 6 | |
Davide Pesavento | 102f057 | 2024-06-22 15:00:06 -0400 | [diff] [blame] | 7 | **ndnsec key-gen** [**-h**] [**-n**] [**-t** *type*] |
Davide Pesavento | 25d9c9f | 2024-06-23 15:10:05 -0400 | [diff] [blame] | 8 | [**-k** *keyidtype*\|\ **\--keyid** *keyid*] *identity* |
Alexander Afanasyev | 151a855 | 2014-04-11 00:54:43 -0700 | [diff] [blame] | 9 | |
| 10 | Description |
| 11 | ----------- |
| 12 | |
Davide Pesavento | 102f057 | 2024-06-22 15:00:06 -0400 | [diff] [blame] | 13 | Generate a public/private key pair for the specified *identity* and set the newly generated |
| 14 | public key as the identity's default key. |
| 15 | Unless :option:`-n` is specified, the identity is also set as the user's default identity. |
Alexander Afanasyev | 151a855 | 2014-04-11 00:54:43 -0700 | [diff] [blame] | 16 | |
Davide Pesavento | 102f057 | 2024-06-22 15:00:06 -0400 | [diff] [blame] | 17 | This command will automatically create a signing request for the generated key. |
| 18 | The signing request will be written to the standard output in Base64 encoding. |
Alexander Afanasyev | 151a855 | 2014-04-11 00:54:43 -0700 | [diff] [blame] | 19 | |
| 20 | Options |
| 21 | ------- |
| 22 | |
Davide Pesavento | b310efb | 2019-04-11 22:10:24 -0400 | [diff] [blame] | 23 | .. option:: -n, --not-default |
Alexander Afanasyev | 151a855 | 2014-04-11 00:54:43 -0700 | [diff] [blame] | 24 | |
Davide Pesavento | b310efb | 2019-04-11 22:10:24 -0400 | [diff] [blame] | 25 | Do not set the identity as the user's default identity. |
Alexander Afanasyev | 2a047eb | 2014-11-30 22:45:02 -0800 | [diff] [blame] | 26 | |
Davide Pesavento | b310efb | 2019-04-11 22:10:24 -0400 | [diff] [blame] | 27 | Note that if no other identity/key/certificate exists, then the identity |
| 28 | will become the default regardless of this option. |
Yingdi Yu | 7d8644a | 2014-12-01 22:55:49 -0800 | [diff] [blame] | 29 | |
Davide Pesavento | b310efb | 2019-04-11 22:10:24 -0400 | [diff] [blame] | 30 | .. option:: -t <type>, --type <type> |
| 31 | |
Davide Pesavento | 702467b | 2020-04-22 21:41:23 -0400 | [diff] [blame] | 32 | Type of key to generate. "r" for RSA, "e" for ECDSA (the default). |
Davide Pesavento | b310efb | 2019-04-11 22:10:24 -0400 | [diff] [blame] | 33 | |
| 34 | .. option:: -k <keyidtype>, --keyid-type <keyidtype> |
| 35 | |
Zhiyi Zhang | 4c68b6e | 2020-04-20 16:13:21 -0700 | [diff] [blame] | 36 | Type of KeyId for the generated key. "r" for a 64-bit random number (the default |
Davide Pesavento | 102f057 | 2024-06-22 15:00:06 -0400 | [diff] [blame] | 37 | unless :option:`--keyid` is specified), "h" for the SHA-256 of the public key. |
Zhiyi Zhang | 4c68b6e | 2020-04-20 16:13:21 -0700 | [diff] [blame] | 38 | |
| 39 | .. option:: --keyid <keyid> |
| 40 | |
| 41 | User-specified KeyId. Must be a non-empty generic name component. |
Davide Pesavento | b310efb | 2019-04-11 22:10:24 -0400 | [diff] [blame] | 42 | |
Davide Pesavento | 102f057 | 2024-06-22 15:00:06 -0400 | [diff] [blame] | 43 | Examples |
| 44 | -------- |
Alexander Afanasyev | 151a855 | 2014-04-11 00:54:43 -0700 | [diff] [blame] | 45 | |
Davide Pesavento | 102f057 | 2024-06-22 15:00:06 -0400 | [diff] [blame] | 46 | Generate a new default key for the identity ``/ndn/test/david``:: |
Alexander Afanasyev | 151a855 | 2014-04-11 00:54:43 -0700 | [diff] [blame] | 47 | |
Davide Pesavento | 102f057 | 2024-06-22 15:00:06 -0400 | [diff] [blame] | 48 | $ ndnsec key-gen /ndn/test/david |
| 49 | Bv0BNwcxCANuZG4IBHRlc3QIBWRhdmlkCANLRVkICLe4LjaLILlwCARzZWxmNggA |
| 50 | AAGQQSVMERQJGAECGQQANu6AFVswWTATBgcqhkjOPQIBBggqhkjOPQMBBwNCAASc |
| 51 | RppJ1qQzCpTyjvsX33fW9/WxopTdoEwfMZENOC960YB7g/LMhWx10ws4benYxIO2 |
| 52 | ELirW0NZ6Wu5VUuzfyjfFlIbAQMcIwchCANuZG4IBHRlc3QIBWRhdmlkCANLRVkI |
| 53 | CLe4LjaLILlw/QD9Jv0A/g8yMDI0MDYyMlQxODExMjH9AP8PMjA0NDA2MTdUMTgx |
| 54 | MTIxF0YwRAIgLJWFpcWrmaOuXW5W+im9al+7TinaEqodve+vrJ2VE5sCIHyrWB+5 |
| 55 | g2bl11aVNycEnMvG8KRSJoHRvNkx7+6RV33s |
| 56 | |
| 57 | See Also |
| 58 | -------- |
| 59 | |
| 60 | :manpage:`ndnsec-cert-gen(1)`, |
| 61 | :manpage:`ndnsec-sign-req(1)` |