hostlocal - v2.2.1
    Preparing search index...

    Interface KeyCert

    A certificate and its private key.

    interface KeyCert {
        ca: undefined | KeyCert;
        cert: string;
        get certFile(): undefined | string;
        delete(opts?: Required<CommonCertOptions>, log?: Logger): Promise<void>;
        get issuer(): string;
        key: undefined | string;
        get keyFile(): undefined | string;
        name: string;
        get notAfter(): Date;
        get notBefore(): Date;
        get san(): undefined | GeneralName[];
        get serial(): string;
        get subject(): string;
        verify(): boolean;
        write(opts: RequiredCommonCertOptions, log: Logger): Promise<void>;
    }
    Index

    Properties

    ca: undefined | KeyCert
    cert: string
    key: undefined | string
    name: string

    Accessors

    • get certFile(): undefined | string

      The file name of the certificate. The file is encoded as PEM.

      Returns undefined | string

      The filename, or undefined if unknown.

    • get issuer(): string

      Issuer DN string.

      Returns string

      A string of the form '/C=US'.

    • get keyFile(): undefined | string

      The account name of the key, stored under KEYCHAIN_SERVICE in the OS-specific keychain. This corresponds to the file name that the key used to be stored in. This file should no longer exist after the upgrade procedure runs.

      Returns undefined | string

      If known, the filename, otherwise undefined.

    • get notAfter(): Date

      Certificate not valid after this date.

      Returns Date

      Date constructed from X509.

    • get notBefore(): Date

      Certificate not valid before this date.

      Returns Date

      Date constructed from X509.

    • get san(): undefined | GeneralName[]

      List of subjectAlternativeNames for the cert.

      Returns undefined | GeneralName[]

      Array of {dns: 'hostname'} or {ip: 'address'} objects.

    • get serial(): string

      Serial number of the cert.

      Returns string

      Hex string.

    • get subject(): string

      Subject name of the cert.

      Returns string

      String of the form '/CN=localhost'.

    Methods

    • Delete this key, if it isn't temporary.

      Parameters

      • Optionalopts: Required<CommonCertOptions>

        Options, of which temp is the most important.

      • Optionallog: Logger

        Logger.

      Returns Promise<void>

      Promise that completes when done deleting.

    • Verify the certificate with its issuer. If no CA, returns false.

      Returns boolean

      True if valid.

    • Save the cert file and key, unless this is temporary.

      Parameters

      • opts: RequiredCommonCertOptions

        Options, of which temp is the most important.

      • log: Logger

        Logger.

      Returns Promise<void>

      Promise that completes when writing is done.