Renewing a CA-signed certificate

About this task

If a CA signed certificate is close to expiry, it is possible to renew the certificate by recreating a new certificate signing request.

Procedure

In this task, as an example, refer cert1_renew.csr as the recreated certificate request and cert1_renew.pem as the renewed certificate signed by the CA.

  1. List the certificates in the keystore, then use the label "cert1" of the personal certificate to get detailed information on this certificate. Check the expiration date shown as the "Not after:" value.
    gsk8capicmd_64 -cert -list -db renew.p12 -stashed
    Certificates found
    
    * default, - personal, ! trusted, # secret key
    
    !       ddRoot
    -      cert1
    gsk8capicmd_64 -cert -details -db renew.p12 -stashed -label cert1
    Label : cert1
    Key Size : 2048
    Version : X509 V3
    Serial : 6363d2bef7cd7e20
    Issuer : CN=Dave,C=US
    Subject : CN=domain,O=you,C=US
    Not Before : September 28, 2022 4:29:52 PM CDT
    
    Not After : September 30, 2022 4:29:52 PM CDT   
  2. Recreate the certificate signing request by running:
    gsk8capicmd_64 -certreq -recreate -db renew.p12 -stashed -label cert1 -target cert1_renew.csr
  3. Send the newly recreated certificate request to the original Certificate Authority (CA) for signing. Upon receiving the renewed certificate from the CA in file "cert1_renew.pem", place this renewed certificate in your server keystore by running:
    gsk8capicmd_64 -cert -receive -db renew.p12 -stashed -file cert1_renew.pem
  4. Verify the details of the renewed certificate:
    
    gsk8capicmd_64 -cert -details -db renew.p12 -stashed -label cert1
    
    Label : cert1
    Key Size : 2048
    Version : X509 V3
    Serial : 303c392837085051
    Issuer : CN=Dave,C=US
    Subject : CN=domain,O=you,C=US
    Not Before : September 28, 2022 4:45:04 PM CDT
    
    Not After : September 24, 2023 4:45:04 PM CDT