Enrolling Cisco ASA for certificates via terminal

This procedure is largely the same as in IOS.


Generate Keys:

ciscoasa(config)# crypto key generate rsa general-keys modulus 1024
INFO: The name for the keys will be:
Keypair generation process begin. Please wait...


Verify keys have been generated:

ciscoasa(config)# show crypto key mypubkey rsa
Key pair was generated at: 14:56:09 UTC Apr 5 2013
Key name:
 Usage: General Purpose Key
 Modulus Size (bits): 1024
 Key Data:

  30819f30 0d06092a 864886f7 0d010101 05000381 8d003081 89028181 00c0a355



Create trustpoint for root CA:

ciscoasa(config)# crypto ca trustpoint ORCA1-CA
ciscoasa(config-ca-trustpoint)# enrollment terminal

ciscoasa(config)# crypto ca authenticate ORCA1-CA
Enter the base 64 encoded CA certificate.
End with the word "quit" on a line by itself
-----BEGIN CERTIFICATE-----
-----END CERTIFICATE-----

quit

INFO: Certificate has the following attributes:
Fingerprint:     e9fd8a22 e82c13ef 5db781a7 616ad113
Do you accept this certificate? [yes/no]: yes

Trustpoint CA certificate accepted.

% Certificate successfully imported

While IOS shows both MD5 and SHA1 fingerprints, ASA shows only MD5. My certificate template is configured to use SHA1 as hashing algorithm. In order to compare the thumbprints, I had to use an external hashing utility. I used MD5Summer. We need to hash the certificate in .CRT  or binary .CER format (binary DER – Distinguished Encoding Rules - encoded).  




Create truspoint for subordinate CA:

ciscoasa(config)# crypto ca trustpoint IssuingCA-DC1
ciscoasa(config-ca-trustpoint)# enrollment terminal

ciscoasa(config)# crypto ca authenticate IssuingCA-DC1
Enter the base 64 encoded CA certificate.
End with the word "quit" on a line by itself
-----BEGIN CERTIFICATE-----
-----END CERTIFICATE-----
quit

INFO: Certificate has the following attributes:
Fingerprint:     537adc87 22cc6e2b 07fdf2e0 18d8ba8b
Do you accept this certificate? [yes/no]: yes

Certificate validated - Signed by existing trustpoint CA certificate.

Trustpoint CA certificate accepted.

% Certificate successfully imported

Verify the thumbprint:




Verify trustpoints:

ciscoasa# show crypto ca trustpoints

Trustpoint ORCA1-CA:
    Subject Name:
    cn=ORCA1-CA
          Serial Number: 37a15821a55dd2864b62a67b6efd5429
    Certificate configured.

Trustpoint IssuingCA-DC1:
    Subject Name:
    cn=IssuingCA-DC1
    dc=kp
    dc=local
          Serial Number: 4d00000002924dec093140270b000000000002
    Certificate configured.



Generate Certificate Signing Request (CSR):

ciscoasa(config)# crypto ca enroll IssuingCA-DC1

Would you like to continue with this enrollment? [yes/no]: yes
% Start certificate enrollment ..

% The fully-qualified domain name in the certificate will be: ciscoasa

% Include the device serial number in the subject name? [yes/no]: yes

% The serial number in the certificate will be: 123456789AB

Display Certificate Request to terminal? [yes/no]: yes
Certificate Request follows:
-----BEGIN CERTIFICATE REQUEST-----
-----END CERTIFICATE REQUEST-----

Redisplay enrollment request? [yes/no]: no


Sign the request:

C:\> certreq -submit -attrib CertificateTemplate:RouterCert .\asa1.csr asa1.pem

Import certificate:

ciscoasa(config)# crypto ca import IssuingCA-DC1 certificate


Verify certificates:

ciscoasa# show crypto ca certificates

Certificate
  Status: Available
  Certificate Serial Number: 6d00000040400187689d214e1e000000000040
  Certificate Usage: General Purpose
  Public Key Type: RSA (1024 bits)
  Signature Algorithm: SHA1 with RSA Encryption
  Issuer Name:
    cn=IssuingCA-DC1
    dc=kp
    dc=local
  Subject Name:
    hostname=ciscoasa
    serialNumber=123456789AB
  CRL Distribution Points:
    [1]  http://dc1.kp.local/pki/IssuingCA-DC1.crl
  Validity Date:
    start date: 15:35:33 UTC Apr 5 2013
    end   date: 12:54:58 UTC Mar 14 2014
  Associated Trustpoints: IssuingCA-DC1

CA Certificate
  Status: Available
  Certificate Serial Number: 4d00000002924dec093140270b000000000002
  Certificate Usage: Signature
  Public Key Type: RSA (2048 bits)
  Signature Algorithm: SHA1 with RSA Encryption
  Issuer Name:
    cn=ORCA1-CA
  Subject Name:
    cn=IssuingCA-DC1
    dc=kp
    dc=local
  CRL Distribution Points:
    [1]  http://dc1.kp.local/ORCA1-CA.crl
  Validity Date:
    start date: 12:44:58 UTC Mar 14 2013
    end   date: 12:54:58 UTC Mar 14 2014
  Associated Trustpoints: IssuingCA-DC1

CA Certificate
  Status: Available
  Certificate Serial Number: 37a15821a55dd2864b62a67b6efd5429
  Certificate Usage: Signature
  Public Key Type: RSA (2048 bits)
  Signature Algorithm: SHA1 with RSA Encryption
  Issuer Name:
    cn=ORCA1-CA
  Subject Name:
    cn=ORCA1-CA
  Validity Date:
    start date: 15:03:12 UTC Mar 13 2013
    end   date: 15:13:12 UTC Mar 13 2023
  Associated Trustpoints: ORCA1-CA



No comments:

Post a Comment