PKI-Lite - v1.2.1
    Preparing search index...

    Builder class for creating X.509 Certificate Revocation Lists (CRLs).

    Provides a fluent API for constructing CRLs with revoked certificates, extensions, and signing them with a CA's private key.

    const crl = await CertificateList.builder()
    .setIssuer('CN=My CA, O=My Org')
    .setPrivateKey(caPrivateKey)
    .setThisUpdate(new Date())
    .setNextUpdate(new Date(Date.now() + 30 * 24 * 60 * 60 * 1000))
    .addRevokedCertificate({
    serialNumber: 12345,
    revocationDate: new Date(),
    })
    .build()

    Implements

    Index

    Constructors

    Methods

    • Adds a revoked certificate entry.

      Parameters

      • entry:
            | RevokedCertificate
            | {
                crlEntryExtensions?: Extension[];
                revocationDate: Date;
                serialNumber: string
                | number;
            }

        Revoked certificate details, or a RevokedCertificate instance

      Returns this

      This builder for chaining

      builder.addRevokedCertificate({
      serialNumber: 12345,
      revocationDate: new Date(),
      })
    • Revokes a certificate by reference. Uses the certificate's serial number and the current time as the revocation date if not provided.

      Parameters

      • certificate: Certificate

        The certificate to revoke

      • OptionalrevocationDate: Date

        The revocation date (defaults to now)

      Returns this

      This builder for chaining