Skip to content

Renewing certificates

Device certificates are valid for two years (730 days) by default. Renew about 30 days before expiry.

  1. Generate a new private key on the device and make a CSR. Reusing the same key works, but a new key is recommended.

  2. Send the new CSR to POST /v1/certificates/{serial}/renew with the current certificate’s serial.

    터미널 창
    jq -n --rawfile csr device-new.csr '{csrPem: $csr}' \
    | pki -X POST "$PKI_API/v1/certificates/$SERIAL/renew" -d @- > renewed.json
  3. With automatic issuance you get 201 with the new certificate and chain. With manual issuance you get 202 and wait for approval.

  4. Install the new certificate and chain and check that the device connects with the new key.

As soon as the new certificate is issued, the old one is revoked as superseded. Call renew only when you can install the new certificate right away, so the device does not lose its connection.

  • Renewal also takes the CN from the device registry, with the same profile as the old certificate.
  • A revoked certificate cannot be renewed (409 CERTIFICATE_REVOKED). Issue a new one instead.
  • Devices that are returned or retired cannot be renewed (409 DEVICE_INACTIVE).
  • Suspended vendors cannot renew (403 VENDOR_SUSPENDED).
터미널 창
pki "$PKI_API/v1/certificates?status=valid&limit=1000" \
| jq -r --arg d "$(date -u -v+30d +%Y-%m-%dT%H:%M:%SZ 2>/dev/null || date -u -d '+30 days' +%Y-%m-%dT%H:%M:%SZ)" \
'.data[] | select(.notAfter < $d) | [.serial, .deviceSerial, .notAfter] | @tsv'