UNPKG

@wildboar/pkcs

Version:
42 lines (41 loc) 1.63 kB
import { ASN1Element as _Element } from "asn1-ts"; import * as $ from "asn1-ts/dist/node/functional"; import { AttributeCertificate } from "@wildboar/x500/src/lib/modules/AttributeCertificateDefinitions/AttributeCertificate.ta"; import { Certificate } from "@wildboar/x500/src/lib/modules/AuthenticationFramework/Certificate.ta"; import { ExtendedCertificate } from "../CryptographicMessageSyntax/ExtendedCertificate.ta"; /** * @summary CertificateChoices * @description * * ### ASN.1 Definition: * * ```asn1 * CertificateChoices ::= CHOICE { * certificate Certificate, -- See X.509 * extendedCertificate [0] IMPLICIT ExtendedCertificate, -- Obsolete * attrCert [1] IMPLICIT AttributeCertificate * } * ``` */ export declare type CertificateChoices = { certificate: Certificate; } | { extendedCertificate: ExtendedCertificate; } | { attrCert: AttributeCertificate; }; /** * @summary Decodes an ASN.1 element into a(n) CertificateChoices * @function * @param {_Element} el The element being decoded. * @returns {CertificateChoices} The decoded data structure. */ export declare function _decode_CertificateChoices(el: _Element): CertificateChoices; /** * @summary Encodes a(n) CertificateChoices into an ASN.1 Element. * @function * @param {value} el The element being decoded. * @param elGetter A function that can be used to get new ASN.1 elements. * @returns {_Element} The CertificateChoices, encoded as an ASN.1 Element. */ export declare function _encode_CertificateChoices(value: CertificateChoices, elGetter: $.ASN1Encoder<CertificateChoices>): _Element;