/*! * x509.js - X509 for javascript * Copyright (c) 2018-2019, Christopher Jeffrey (MIT License). * https://github.com/bcoin-org/bcrypto * * Parts of this software are based on indutny/asn1.js: * Copyright Fedor Indutny, 2013. * https://github.com/indutny/asn1.js * * Resources: * https://en.wikipedia.org/wiki/X.509 * https://tools.ietf.org/html/rfc4158 * https://www.ietf.org/rfc/rfc2560.txt * https://www.ietf.org/rfc/rfc5280.txt * https://github.com/indutny/asn1.js/blob/master/rfc/2560/index.js * https://github.com/indutny/asn1.js/blob/master/rfc/5280/index.js * https://github.com/indutny/asn1.js/blob/master/lib/asn1/base/node.js * https://github.com/indutny/asn1.js/blob/master/lib/asn1/encoders/der.js * https://github.com/indutny/asn1.js/blob/master/lib/asn1/decoders/der.js */ import { asn1 } from './asn1'; import { ASN1Any, ASN1BitString, ASN1Bool, ASN1Integer, ASN1Node, ASN1OctString, ASN1OID, ASN1Time, ASN1Unsigned } from './types'; export declare namespace x509 { class Certificate extends asn1.Sequence { tbsCertificate: TBSCertificate; signatureAlgorithm: AlgorithmIdentifier; signature: ASN1BitString; constructor(); get isRaw(): boolean; getBodySize(): number; writeBody(bw: any): any; readBody(br: any): this; clean(): boolean; toPEM(): string; fromPEM(str: any): this; format(): { type: string; tbsCertificate: TBSCertificate; signatureAlgorithm: AlgorithmIdentifier; signature: ASN1BitString; }; } class TBSCertificate extends asn1.Sequence { version: ASN1Unsigned; serialNumber: ASN1Integer; signature: AlgorithmIdentifier; issuer: RDNSequence; validity: Validity; subject: RDNSequence; subjectPublicKeyInfo: SubjectPublicKeyInfo; issuerUniqueID: ASN1BitString; subjectUniqueID: ASN1BitString; extensions: Extensions; constructor(); get isRaw(): boolean; getBodySize(): number; writeBody(bw: any): any; readBody(br: any): this; clean(): boolean; toPEM(): string; fromPEM(str: any): this; format(): { type: string; version: ASN1Unsigned; serialNumber: ASN1Integer; signature: AlgorithmIdentifier; issuer: RDNSequence; validity: Validity; subject: RDNSequence; subjectPublicKeyInfo: SubjectPublicKeyInfo; issuerUniqueID: ASN1BitString; subjectUniqueID: ASN1BitString; extensions: Extensions; }; } class AlgorithmIdentifier extends asn1.Sequence { algorithm: ASN1OID; parameters: ASN1Any; constructor(algorithm?: any, parameters?: any); getBodySize(): number; writeBody(bw: any): any; readBody(br: any): this; clean(): boolean; format(): { type: string; algorithm: ASN1OID; parameters: ASN1Any; }; } class RDNSequence extends asn1.Sequence { names: RDN[]; constructor(); getBodySize(): number; writeBody(bw: any): any; readBody(br: any): this; clean(): boolean; format(): { type: string; names: RDN[]; }; } class RDN extends asn1.Set { attributes: Attribute[]; constructor(id: any, value: any); getBodySize(): number; writeBody(bw: any): any; readBody(br: any): this; clean(): boolean; format(): { type: string; attributes: Attribute[]; }; } class Attribute extends asn1.Sequence { id: ASN1OID; value: ASN1Any; constructor(id: string | number[], value: ASN1Node); getBodySize(): number; writeBody(bw: any): any; readBody(br: any): this; clean(): boolean; format(): { type: string; id: ASN1OID; value: ASN1Any; }; } class Validity extends asn1.Sequence { notBefore: Time; notAfter: Time; constructor(); getBodySize(): number; writeBody(bw: any): any; readBody(br: any): this; clean(): boolean; format(): { type: string; notBefore: Time; notAfter: Time; }; } class Time extends asn1.Choice { node: ASN1Time; constructor(options?: any); choices(): number[]; } class SubjectPublicKeyInfo extends asn1.Sequence { algorithm: AlgorithmIdentifier; publicKey: ASN1BitString; constructor(algorithm?: any, parameters?: any, publicKey?: any); get isRaw(): boolean; getBodySize(): number; writeBody(bw: any): any; readBody(br: any): this; clean(): boolean; toPEM(): string; fromPEM(str: any): this; format(): { type: string; algorithm: AlgorithmIdentifier; publicKey: ASN1BitString; }; } class Extensions extends asn1.Sequence { extensions: Extension[]; constructor(); getBodySize(): number; writeBody(bw: any): any; readBody(br: any): this; clean(): boolean; format(): { type: string; extensions: Extension[]; }; } class Extension extends asn1.Sequence { extnID: ASN1OID; critical: ASN1Bool; extnValue: ASN1OctString; constructor(); getBodySize(): number; writeBody(bw: any): any; readBody(br: any): this; clean(): boolean; format(): { type: string; extnID: ASN1OID; critical: ASN1Bool; extnValue: ASN1OctString; }; } class DigestInfo extends asn1.Sequence { algorithm: AlgorithmIdentifier; digest: ASN1OctString; constructor(algorithm: any, digest: any); getBodySize(): number; writeBody(bw: any): any; readBody(br: any): this; clean(): boolean; format(): { type: string; algorithm: AlgorithmIdentifier; digest: ASN1OctString; }; } }