Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • TrustStore

Index

Constructors

constructor

  • new TrustStore(caCerts: Array<X509Pem | Certificate>, loadCertificates: LoadCertificatesCallback, useDiskCache?: boolean): TrustStore
  • Constructor

    Parameters

    • caCerts: Array<X509Pem | Certificate>

      List of pem encoded x509 certificate authority certificates.

    • loadCertificates: LoadCertificatesCallback

      Callback that loads intermediary certificates.

    • Default value useDiskCache: boolean = true

      Enable / disable intermediary disk cache.

    Returns TrustStore

Properties

Protected caStore

caStore: CAStore

Protected intermediaries

intermediaries: Map<string, Certificate> = new Map()

Internally cached intermediary certificates

Protected loadCertificates

loadCertificates: LoadCertificatesCallback

Protected tmpDir

tmpDir: string = path.join(tmpdir(), TMP_DIRNAME)

useDiskCache

useDiskCache: boolean

Enable / disable caching intermediary certificates to disk

Methods

addIntermediary

  • addIntermediary(certificate: Certificate, cacheToDisk?: boolean): void
  • Add intermediary certificate to internal cache.

    Parameters

    • certificate: Certificate

      Certificate to add.

    • Default value cacheToDisk: boolean = this.useDiskCache

      Also cache this certificate to disk.

    Returns void

Private cacheToDisk

  • cacheToDisk(certificate: Certificate): void
  • Parameters

    • certificate: Certificate

    Returns void

getIntermediaries

  • getIntermediaries(): Certificate[]
  • Get currently cached intermediary certificates

    Returns Certificate[]

isCertificateTrusted

  • isCertificateTrusted(certificate: Certificate, noLoading?: boolean): Promise<boolean>
  • Test if given certificate is trusted.

    Parameters

    • certificate: Certificate

      Certificate to test.

    • Default value noLoading: boolean = false

      Don't attempt to load new intermediary certificates.

    Returns Promise<boolean>

Private loadCachedCertificates

  • loadCachedCertificates(): Promise<void>
  • Load certificates cached to disk.

    Returns Promise<void>

Private verifyCertificate

  • verifyCertificate(certificate: Certificate): boolean
  • Internal verify certificate.

    Parameters

    • certificate: Certificate

    Returns boolean

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method

Generated using TypeDoc