X509 CRL

Index

x509-crl/create x509-crl/entries-count x509-crl/get-entry x509-crl/is-revoked x509-crl/load x509-crl/load-file x509-crl/next-update x509-crl/revoke x509-crl/this-update x509-crl/to-der x509-crl/to-pem x509-crl/verify

x509-crl-entry/create x509-crl-entry/reason x509-crl-entry/revocation-date x509-crl-entry/serial-number

Reference

(x509-crl/create ca-cert ca-key issue-time next-update &keys {:rng rng :hash hash :padding padding})

Create a new empty CRL signed by the given CA.

  • `ca-cert` - The CA certificate object.
  • `ca-key` - The CA's private key object.
  • `issue-time` - The time when the CRL becomes valid, as seconds since epoch.
  • `next-update` - The number of seconds after issue-time until the CRL expires.
  • `:rng` - A random number generator object. Default is system RNG.
  • `:hash` - Hash algorithm name. Default is "SHA-256".
  • `:padding` - Padding scheme. Default depends on key type: "PKCS1v15" for RSA, hash name for DSA/ECDSA, "Pure" for Ed25519/Ed448.
  • (x509-crl/entries-count crl-obj)

    Return the number of entries in the CRL.

    (x509-crl/get-entry crl-obj index)

    Return the CRL entry at the given `index`. Use `x509-crl/entries-count` to get the number of entries.

    (x509-crl/is-revoked crl-obj cert-obj)

    Check if the given `cert-obj` is revoked on the given `crl-obj`. Return true when the certificate is revoked.

    x509-crl/loadcfunction
    (x509-crl/load blob)

    Load a CRL from the DER or PEM encoded `blob`.

    (x509-crl/load-file file-name)

    Load a CRL from a file.

    (x509-crl/next-update crl-obj)

    Return the time the next CRL update is expected, as seconds since epoch. Return `nil` if the CRL has no nextUpdate field, which is optional.

    (x509-crl/revoke crl ca-cert ca-key issue-time next-update entries &keys {:rng rng :hash hash :padding padding})

    Update a CRL with new revoked entries, creating a new CRL. The original CRL is not modified.

  • `crl` - The existing CRL object to update.
  • `ca-cert` - The CA certificate object.
  • `ca-key` - The CA's private key object.
  • `issue-time` - The time when the new CRL becomes valid, as seconds since epoch.
  • `next-update` - The number of seconds after issue-time until the CRL expires.
  • `entries` - A tuple/array of CRL entry objects created with `x509-crl-entry/create`.
  • `:rng` - A random number generator object. Default is system RNG.
  • `:hash` - Hash algorithm name. Default is "SHA-256".
  • `:padding` - Padding scheme. Default depends on key type: "PKCS1v15" for RSA, hash name for DSA/ECDSA, "Pure" for Ed25519/Ed448.
  • (x509-crl/this-update crl-obj)

    Return the time the CRL was issued, as seconds since epoch.

    (x509-crl/to-der crl-obj)

    Encode the CRL as DER binary data.

    (x509-crl/to-pem crl-obj)

    Encode the CRL as a PEM string.

    (x509-crl/verify crl-obj pubkey)

    Verify the CRL signature against the given public key. Returns true if the signature is valid.

    (x509-crl-entry/create cert reason)

    Create a CRL entry for the given certificate with a revocation reason.

  • `cert` - The certificate to mark as revoked.
  • `reason` - The revocation reason, either an integer or a keyword:
  • 0: :unspecified
    1: :key-compromise
    2: :ca-compromise
    3: :affiliation-changed
    4: :superseded
    5: :cessation-of-operation
    6: :certificate-hold
    8: :remove-from-crl
    9: :privilege-withdrawn
    10: :aa-compromise

    (x509-crl-entry/reason crl-entry)

    Return the revocation reason code for the CRL entry.
    0: Unspecified
    1: Key Compromise
    2: CA Compromise
    3: Affiliation Changed
    4: Superseded
    5: Cessation of Operation
    6: Certificate Hold
    8: Remove from CRL
    9: Privilege Withdrawn
    10: AA Compromise

    (x509-crl-entry/revocation-date crl-entry)

    Return the revocation date as seconds since epoch.

    (x509-crl-entry/serial-number crl-entry)

    Return the serial number of the revoked certificate.