Hello,
I’m trying to generate new RSA keys & Certificates on Cisco switches/routers.
The process should be as below. My problem is that i want to execute the first command. then wait to see ([OK]) in the output before proceeding with next commands. But i couldn’t find a way to parse the output of the 1st command in any module i have seen. Any ideas?
router(config)# crypto key generate rsa label RSA-Key modulus 4096
The name for the keys will be: RSA-Key
% The key modulus size is 4096 bits
% Generating 4096 bit RSA keys, keys will be non-exportable…
[OK] (elapsed time was 100 seconds)
router(config)crypto pki trustpoint Self-Signed-Certificate
router(ca-trustpoint)#enrollment selfsigned
router(ca-trustpoint)#subject-name O=GeneratedCertificate,CN=Self-Signed-Certificate
router(ca-trustpoint)#hash sha256
router(ca-trustpoint)#rsakeypair RSA-Key
router(config)crypto pki enroll Self-Signed-Certificate
% Include the router serial number in the subject name? [yes/no]: no
% Include an IP address in the subject name? [no]: no
Generate Self Signed Router Certificate? [yes/no]: yes
Router Self Signed Certificate successfully created