import { AlgorithmIdentifier } from '../crypto/asn1'; import { PrivateKey, SubjectPublicKeyInfo, TbsCertificate } from '../crypto'; /** * The certificate store holds the certificate and the private key * for a simple implementation take a look at @type {PEMDERCertificateStore} */ export interface CertificateStore { /** * @returns client certificate DER */ getCertificate(): Uint8Array | undefined; /** * @returns client certificate chain DER */ getCertificateChain(): Uint8Array | undefined; /** * @returns the crypto key */ getPrivateKey(): PrivateKey | undefined; /** * optional initialization method * if present will be called during client initialization */ init?(options?: CertificateStoreInitOptions): Promise; } export interface CertificateStoreInitOptions { applicationUri?: string; applicationName?: string; organizationName?: string; } export interface SelfSignedCertificateStoreOptions extends CertificateStoreInitOptions { tbsCertificate?: Partial; signatureAlgorithm?: AlgorithmIdentifier; spkiModulusLength?: number; } export declare class NullCertificateStore implements CertificateStore { getCertificate(): undefined; getCertificateChain(): undefined; getPrivateKey(): undefined; } /** * A basic implementation of the certificateStore, that takes a certificate and a private key in PEM format * for example created by: https://certificatetools.com/ * * key usage: * spec says that certificate shall include digitalSignature, nonRepudiation, keyEncipherment and dataEncipherment. * Other key uses are allowed. * * you also have to add a subjectAltName URI * be shure that the subejctAltName matches your applicationUri * */ export declare class PEMDERCertificateStore implements CertificateStore { protected certificateChain: Uint8Array; protected certificate: Uint8Array; protected privateKey: PrivateKey; constructor(certificatePEMOrDER: string | ArrayBuffer, privateKeyPEMOrDER: string | ArrayBuffer); getCertificate(): Uint8Array; getCertificateChain(): Uint8Array; getPrivateKey(): PrivateKey; } export declare class SelfSignedCertificateStore implements CertificateStore { readonly spkiModulusLength: number; protected certificateChain?: Uint8Array; protected certificate?: Uint8Array; protected privateKey?: PrivateKey; protected options: SelfSignedCertificateStoreOptions; constructor(options?: SelfSignedCertificateStoreOptions); getCertificate(): Uint8Array | undefined; getCertificateChain(): Uint8Array | undefined; getPrivateKey(): PrivateKey | undefined; init(options?: CertificateStoreInitOptions): Promise; generateKeyPair(spki: SubjectPublicKeyInfo): Promise; private insertPublicKeyIntoCertificate; private generatePrivateKey; } //# sourceMappingURL=certificate_store.d.ts.map