A public key pair capability in XR Config mode is a security mechanism on Cisco NCS 1004 that
-
supports the generation of crypto key pairs in both FIPS (Federal Information Processing Standard) and non-FIPS modes,
-
enables selection of multiple key types and key sizes, and
-
controls overwriting, deleting, and viewing keys based on XR Config and XR EXEC mode distinctions.
Supported key types for non-FIPS and FIPS modes
The following table lists the key types and key sizes that are supported in non-FIPS and FIPS modes.
Table 1.
Supported Key Types for non-FIPS and FIPS modes
Key Types |
Non-FIPS mode |
FIPS mode |
RSA |
Supported for all key sizes from 512 to 4096 |
Supported for key sizes 2048, 3072, and 4096 |
DSA |
Supported for key sizes 512, 768, and 1024 |
Supported for key size 2048 |
ECDSA |
Supported for key sizes nistp256, nistp384, and nistp512 |
Supported for key sizes nistp256, nistp384, and nistp512 |
ED25519 |
Supported |
Not supported |
Guidelines and restrictions
When you generate crypto key pairs in XR Config mode, the following guidelines and restrictions apply:
-
This feature does not support the generation of system-root-key and system-enroll-key .
-
The key pairs that are generated in XR Config mode overwrite any previously generated key pairs in XR EXEC mode.
-
Cisco NCS 1004 does not support overwriting key pairs that are generated in XR Config mode from XR EXEC mode.
-
When you run the no form of the crypto key generate command in XR Config mode, only the keys that are generated in XR Config mode are deleted.
-
Cisco NCS 1004 does not support deleting key pairs that are generated in XR Config mode from XR EXEC mode.
-
When you run the crypto key generate command in XR EXEC mode, the keys that are generated in XR Config mode are not overwritten or deleted.
-
The show crypto key mypubkey command displays the keys that are generated in XR EXEC mode first, followed by the keys that are generated in XR Config mode.
Configuration exampl
This example shows the creation of key pairs in XR Config mode:
RP/0/RP0/CPU0:ios# conf t
RP/0/RP0/CPU0:ios(config)# crypto key generate dsa 512
RP/0/RP0/CPU0:ios(config)# crypto key generate rsa user1 general-keys 2048
RP/0/RP0/CPU0:ios(config)# crypto key generate rsa user2 usage-keys 2048
RP/0/RP0/CPU0:ios(config)# crypto key generate rsa 2048
RP/0/RP0/CPU0:ios(config)# crypto key generate ecdsa nistp256
RP/0/RP0/CPU0:ios(config)# crypto key generate ecdsa nistp384
RP/0/RP0/CPU0:ios(config)# crypto key generate ecdsa nistp521
RP/0/RP0/CPU0:ios(config)# crypto key generate ed25519
RP/0/RP0/CPU0:ios(config)# commit
Use the no form of the command in XR Config mode to delete any of the key pairs.
System logs and error messages
Cisco NCS 1004 generates the following system logs on successful creation of key pairs:
cepki[287]: %SECURITY-CEPKI-6-KEY_INFO : crypto key DSA generated, label:the_default, modBits:1024
cepki[287]: %SECURITY-CEPKI-6-KEY_INFO : crypto key ECDSA_NISTP256 generated, label:the_default, modBits:256
Cisco NCS 1004 generates the following system logs on deletion of key pairs:
cepki[287]: %SECURITY-CEPKI-6-KEY_INFO : crypto key RSA zeroized, label:user1
cepki[287]: %SECURITY-CEPKI-6-KEY_INFO : crypto key DSA zeroized, label:the_default
Cisco NCS 1004 generates the following error messages if you try to overwrite key pairs that are generated in XR Config mode from XR EXEC mode:
RP/0/RP0/CPU0:ios# conf t
RP/0/RP0/CPU0:ios(config)# crypto key generate ed25519
RP/0/RP0/CPU0:ios(config)# commit
RP/0/RP0/CPU0:ios(config)# crypto key generate ed25519
Cannot execute the command : Operation not permitted
ce_cmd[68727]: %SECURITY-CEPKI-6-ERR_2 : Cannot execute the command : Operation not permitted
ce_cmd[68736]: %SECURITY-CEPKI-6-ERR : Key is added as part of config mode, key deletion is not allowed , delete key from config mode
Cisco NCS 1004 generates the following error messages if you try to delete key pairs that are generated in XR Config mode from XR EXEC mode:
RP/0/RP0/CPU0:ios# conf t
RP/0/RP0/CPU0:ios(config)# crypto key generate ed25519
RP/0/RP0/CPU0:ios(config)# commit
RP/0/RP0/CPU0:ios(config)# crypto key zeroize ed25519
Cannot execute the command : Operation not permitted
ce_cmd[68736]: %SECURITY-CEPKI-6-ERR_2 : Cannot execute the command : Operation not permitted
Viewing the generated key pairs
You can view the key pairs that are generated in XR Config mode, listed under Public keys from config sysdb in the following command output:
RP/0/RP0/CPU0:ios# show crypto key mypubkey ecdsa
Key label: the_default
Type : ECDSA General Curve Nistp256
Degree : 256
Created : 11:49:22 IST Wed Apr 21 2021
Data :
04D6D132 2253ABD0 81449E3F 9D5CEA3A 1107950A 829E9090 8960FBD5 ABA039B7
24A4E217 7EA47475 91C60AC7 013DBC2E EA8434D9 0BD5B0FC 694913AE 0098A4F5
77
Key label: the_default
Type : ECDSA General Curve Nistp521
Degree : 521
Created : 22:44:22 IST Thu Mar 18 2021
Data :
04017798 4369F493 8D0E57D1 1975FC46 CDC03A78 03A9F90E B38CA504 17DB9A64
D1DEA6A6 D23E7E20 4D8D4D31 C7878BDB BF5EEE40 1978A889 70C5D703 BB033B77
0FFD9201 366A9AC8 35E69BB3 97FF4E91 6B498510 39425971 C5E43858 83286088
A6A7BF92 0EA2B416 BD4E81CE DCEB65F1 15CC75B5 91204E89 3339A168 2382CAB6
40170131 8F
-----------------------------
Public keys from config sysdb:
-----------------------------
Key label: the_default
Type : ECDSA General Curve Nistp384
Degree : 384
Created : 11:51:52 IST Wed Apr 21 2021
Data :
045F7C14 1A88C27E 9CED3FF1 7FEDFA03 B49575FA 7AD88370 BC9C7D7F F99C8917
33620916 758BDEFC 7187E33A 2D3CCD33 14FF3267 9855A5E9 E3BD166C CE838462
40742231 6198EE12 3E189F42 22A8149A 8E7B186D 88E728D4 7F47D565 53441061
79