Keeta LogoKeeta Logo@keetanetwork/keetanet-client
    Preparing search index...
    Index

    Constructors

    Properties

    baseExtensions?: {
        authorityKeyIdentifier?: { contains: Buffer; type: "context"; value: 0 };
        basicConstraints?: [ca: boolean, pathLenConstraint?: bigint];
        subjectKeyIdentifier?: Buffer;
    }

    Basic Extensions

    Type declaration

    • OptionalauthorityKeyIdentifier?: { contains: Buffer; type: "context"; value: 0 }

      Authority Key Identifier

    • OptionalbasicConstraints?: [ca: boolean, pathLenConstraint?: bigint]

      Basic Constraints

    • OptionalsubjectKeyIdentifier?: Buffer

      Subject Key Identifier

    chain?: Certificate[]

    Chain, if a store is provided

    issuer: string

    The Issuer DN of the certificate as a string --- for informational purposes only

    issuerDN: ASN1Set[]

    The complete IssuerDN

    moment: null | Date

    The moment at which the certificate was validated

    notAfter: Date

    The timestamp at which the certificate expires

    notBefore: Date

    The timestamp at which the certificate becomes valid

    serial: bigint

    The serial number of the certificate

    subject: string

    The Subject DN of the certificate as a string --- for informational purposes only

    subjectDN: ASN1Set[]

    The complete SubjectDN

    subjectPublicKey: Account

    The Subject of the certificate as a KeetaNet Account, derived from the public key in the certificate

    Builder: typeof CertificateBuilder = CertificateBuilder

    The Certificate Builder

    Accessors

    • get trusted(): boolean

      If this certificate can be trusted to have been validated to a trusted Root CA

      Returns boolean

    Methods

    • Asserts provided certificates can construct a valid graph with no loops or orphans, and that all provided certificates can reach the root, or current certificate

      Parameters

      • certificates: Set<Certificate>

        Additional intermediate certificates to verify

      Returns undefined | true

    • Assert that the certificate is valid at a given moment

      Parameters

      • Optionalmoment: null | Date

      Returns void

    • Check if the certificate is issued by a given issuer

      Parameters

      Returns boolean

    • Check if the certificate is issued by a given issuer

      Parameters

      Returns { issued: true } | { issued: false; reason: string }

    • Check if the certificate is valid at a given moment

      Parameters

      • Optionalmoment: null | Date

      Returns boolean

    • Check if the certificate is valid at a given moment

      Parameters

      • Optionalmoment: null | Date
      • Optionalreason: false

      Returns boolean

    • Check if the certificate is valid at a given moment

      Parameters

      • Optionalmoment: null | Date
      • Optionalreason: true

      Returns { valid: true } | { reason: string; valid: false }

    • Compare the certificate with another certificate and return true if they are the same

      Parameters

      Returns boolean

    • Finalize construction of the certificate -- if this method is replaced in a subclass, remember to call it at the end of the subclass constructor or the certificate will not be fully constructed

      Returns void

    • Verifies that a certificate is self-signed

      Returns boolean

    • Process an extension -- returns true if the extension was processed

      This is intended to be overridden by subclasses for processing custom extensions

      Parameters

      • id: string
      • value: ArrayBuffer

      Returns boolean

    • Process remaining extensions

      Returns void

    • Get the certificate as a DER encoded ArrayBuffer

      Returns ArrayBuffer

    • Get a JSON representation of the certificate

      Parameters

      Returns {
          $binary?: string;
          $chain?: unknown;
          $hash: CertificateHash;
          baseExtensions:
              | undefined
              | {
                  authorityKeyIdentifier?: {
                      contains: Buffer;
                      type: "context";
                      value: 0;
                  };
                  basicConstraints?: [ca: boolean, pathLenConstraint?: bigint];
                  subjectKeyIdentifier?: Buffer;
              };
          issuer: string;
          issuerDN: { name: string; value: string }[];
          notAfter: Date;
          notBefore: Date;
          serial: bigint;
          subject: string;
          subjectDN: { name: string; value: string }[];
          subjectPublicKey: Account<ECDSA_SECP256K1 | ED25519 | ECDSA_SECP256R1>;
      }

    • Get the certificate as a PEM encoded string

      Returns string

    • Is a certificate object?

      Parameters

      • value: unknown

      Returns value is Certificate