/* tslint:disable */ /* eslint-disable */ /* auto-generated by NAPI-RS */ /** ASN1 OID. */ export interface ASN1OID { type: 'oid' oid: string } /** ASN1 Set. */ export interface ASN1Set { type: 'set' name: ASN1OID value: string | ASN1String } /** ASN1 String. */ export interface ASN1String { type: 'string' value: string kind: 'ia5' | 'utf8' | 'printable' } /** ASN1 Date. */ export interface ASN1Date { type: 'date' kind?: 'utc' | 'general' | 'default' date: Date } /** ASN1 JS Context Tag. */ export interface ASN1ContextTag { type: 'context' kind: 'implicit' | 'explicit' value: number contains: any } /** ASN1 JS bit string. */ export interface ASN1BitString { type: 'bitstring' value: Buffer unusedBits?: number } /** Shim to surface ASN1Struct in generated TypeScript declarations only. */ export interface ASN1Struct { type: 'struct' fieldNames?: Array contains: Record } /** Helper to convert a JS bigint to a JS Buffer */ export declare function ASN1BigIntToBuffer(data: bigint): Buffer /** Helper to convert a JS Buffer to a JS bigint */ export declare function BufferToBigInt(data: Buffer): bigint /** Helper to convert a JS number to a JS BigInt */ export declare function ASN1IntegerToBigInt(data: object | number): bigint /** Helper to convert a JS string to a JS BigInt */ export declare function StringToBigInt(data: string): bigint /** Convert JS input into ASN1 BER encoded data. */ export declare function JStoASN1( data: Readonly, allowUndefined?: boolean, ): any /** * Convert ASN1 BER encoded data to JS native types. * This supports number arrays, Buffer, ArrayBufferLike, base64 or hex * encded strings, or null input. */ export declare function ASN1toJS(data: ArrayBuffer): ASN1AnyJS /** * Convert ASN1 BER encoded data to JS native types. This is the main decoder * class for decoding ASN1 encoded data. */ export class ASN1Decoder { /** JS constructor. */ constructor(data: string | null | number[] | Buffer | ArrayBuffer) /** Create an instance of ANS1 from a buffer. */ static fromBuffer(value: Buffer): ASN1Decoder /** Create an instance of ANS1 from Base64 encoded data. */ static fromBase64(value: string): ASN1Decoder /** Create an instance of ANS1 from hex encoded data. */ static fromHex(value: string): ASN1Decoder /** Convert to an integer. */ intoInteger(): number /** Convert to a JS big integer. */ intoBigInt(): bigint /** Convert to a boolean. */ intoBool(): boolean /** Convert to a string. */ intoString(): string /** Convert to a date. */ intoDate(): Date /** Convert to an byte array. */ intoBytes(): Array /** Convert to a buffer. */ intoBuffer(): Buffer /** Convert to an OID object. */ intoOid(): ASN1OID /** Convert to a JS ASN1BitString object. */ intoBitString(): ASN1BitString /** Convert to an Context object. */ intoContextTag(): ASN1ContextTag /** Convert a Sequence to an Array. */ intoArray(): any[] } /** * Convert ASN1Data into ASN1 encoded data. This is the main encoder * class for encoding to ASN1 encoded data. */ export class ASN1Encoder { /** Create a new ASN1Encoder instance from any ASN1 encodable type. */ constructor(data: ASN1AnyJS) /** Encode the ASN.1 data as an array buffer. */ toBER(sizeOnly?: boolean | undefined | null): ArrayBuffer /** Encode the ASN.1 data to a ASN.1 encoded base64 encoded string. */ toBase64(): string } /** * ASN1 Iterator for sequences. Sequences use lazy loading iterators allowing * for chaining of operations while only executing on a consumer ensuring * O(n) operations. */ export class ASN1Iterator {} export type ASN1AnyJS = ASN1AnyJS[] | bigint | number | Date | Buffer | ASN1OID | ASN1Set | ASN1ContextTag | ASN1BitString | ASN1Date | ASN1String | ASN1Struct | string | boolean | null | undefined;