@wildboar/pkcs
Version:
Public Key Cryptography Standard PDUs in TypeScript
42 lines (41 loc) • 1.59 kB
TypeScript
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 "../PKCS7/ExtendedCertificate.ta";
/**
* @summary CertificateChoice
* @description
*
* ### ASN.1 Definition:
*
* ```asn1
* CertificateChoice ::= CHOICE {
* certificate Certificate,
* extendedCertificate [0] ExtendedCertificate, -- Obsolete
* attributeCertificate [1] AttributeCertificate
* }
* ```
*/
export declare type CertificateChoice = {
certificate: Certificate;
} | {
extendedCertificate: ExtendedCertificate;
} | {
attributeCertificate: AttributeCertificate;
};
/**
* @summary Decodes an ASN.1 element into a(n) CertificateChoice
* @function
* @param {_Element} el The element being decoded.
* @returns {CertificateChoice} The decoded data structure.
*/
export declare function _decode_CertificateChoice(el: _Element): CertificateChoice;
/**
* @summary Encodes a(n) CertificateChoice 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 CertificateChoice, encoded as an ASN.1 Element.
*/
export declare function _encode_CertificateChoice(value: CertificateChoice, elGetter: $.ASN1Encoder<CertificateChoice>): _Element;