UNPKG

ecash-lib

Version:

Library for eCash transaction building

61 lines 1.89 kB
/** Identifier of a signature algorithm */ export interface AlgIdent { /** OID of the algorithm */ oid: string; /** OID of the params */ params: string | undefined; } /** Entry of an issuer/subject */ export interface Entry { /** OID of the entry */ oid: string; /** Value of the entry */ value: string; } /** Time range of the validity of the certificate */ export interface Validity { /** Certificate is not valid before this UNIX timestamp */ notBefore: number; /** Certificate is not valid after this UNIX timestamp */ notAfter: number; } /** Public key of a certificate */ export interface PubKey { /** Signature algorithm of the public key */ alg: AlgIdent; /** Bytes of the public key */ data: Uint8Array; } /** To-be-signed data of the certificate */ export interface TBS { /** Version of the certificate data */ version: number | undefined; /** Serial number of the certificate */ serial: Uint8Array; /** Signature algorithm used by the certificate */ sigAlg: AlgIdent; /** Fields of the issuer of the certificate */ issuer: Entry[]; /** Time range the certificate is valid */ validity: Validity; /** Fields of the subject of the certificate */ subject: Entry[]; /** Public key of the certificate */ pubkey: PubKey; /** Raw bytes of the data to be signed */ raw: Uint8Array; } export interface Cert { /** Data to be signed by the signature */ tbs: TBS; /** Algorithm used for the signature */ sigAlg: AlgIdent; /** Signature signing `tbs` */ sig: Uint8Array; /** Raw bytes of the certificate */ raw: Uint8Array; } /** Parse a ASN1 certificate from the given bytes */ export declare function parseCertRaw(rawCert: Uint8Array): Cert; export declare function parseCertPem(pem: string): Cert; //# sourceMappingURL=asn1.d.ts.map