@smartdcc/dccboxed-keystore
Version:
DCC Boxed server keystore exposed as json db.
74 lines • 2.67 kB
TypeScript
import { KeyObject, X509Certificate } from 'node:crypto';
import { EUI, KeyUsage, CertificateMetadata } from './certificateMetadata';
import { Headers } from './certificateSearch';
import { KeyStoreDB, MaybeList, QueryOptions } from './db';
export declare const defaultBackingFile: string;
export declare class BoxedKeyStore extends KeyStoreDB {
private boxedAddress;
private backingDB;
private _temporyFile?;
private headers?;
get temporyFile(): string | undefined;
/**
* Creates a new caching key store
*
* @param boxedAddress ip address of a DCC Boxed instance
* @param backingDB backing readonly database
* @param localFile local file to cache updates to, if undefined a temporary file is created
* @param _temporyFile
*/
protected constructor(boxedAddress: string, backingDB: KeyStoreDB, localFile: string, _temporyFile?: string | undefined, headers?: Headers | undefined);
/**
* Wrap constructor for async operations.
*
* @param boxedAddress ip address of a DCC Boxed instance
* @param localFile local file to cache updates to, if undefined a temporary file is created
* @param backingFile backing readonly database file, if undefined a default backing file is used
* @returns
*/
static new(boxedAddress: string, localFile?: string, backingFile?: string, headers?: Headers): Promise<BoxedKeyStore>;
query(options: {
eui: string | Uint8Array | EUI;
keyUsage: KeyUsage;
role?: number | undefined;
lookup: 'privateKey';
}): Promise<(CertificateMetadata & {
name?: string;
privateKey: KeyObject;
})[] | null>;
query(options: {
eui: string | Uint8Array | EUI;
keyUsage: KeyUsage;
role?: number | undefined;
lookup: 'certificate';
}): Promise<(CertificateMetadata & {
name?: string;
certificate: X509Certificate;
})[] | null>;
query(options: {
serial: bigint;
lookup: 'privateKey';
}): Promise<(CertificateMetadata & {
name?: string;
privateKey: KeyObject;
}) | null>;
query(options: {
serial: bigint;
lookup: 'certificate';
}): Promise<(CertificateMetadata & {
name?: string;
certificate: X509Certificate;
}) | null>;
query(options: QueryOptions): Promise<MaybeList<CertificateMetadata & {
name?: string;
} & ({
certificate: X509Certificate;
} | {
privateKey: KeyObject;
})> | null>;
/**
* deletes any temporary files created
*/
cleanup(): Promise<void>;
}
//# sourceMappingURL=boxedKeyStore.d.ts.map