UNPKG

@wildboar/pkcs

Version:
31 lines (30 loc) 1.28 kB
import * as $ from "@wildboar/asn1/functional"; import { _decode_CertificateChoices, _encode_CertificateChoices, } from "../CryptographicMessageSyntax/CertificateChoices.ta.mjs"; let _cached_decoder_for_CertificateSet = null; /** * @summary Decodes an ASN.1 element into a(n) CertificateSet * @function * @param {_Element} el The element being decoded. * @returns {CertificateSet} The decoded data structure. */ export function _decode_CertificateSet(el) { if (!_cached_decoder_for_CertificateSet) { _cached_decoder_for_CertificateSet = $._decodeSetOf(() => _decode_CertificateChoices); } return _cached_decoder_for_CertificateSet(el); } let _cached_encoder_for_CertificateSet = null; /** * @summary Encodes a(n) CertificateSet into an ASN.1 Element. * @function * @param value The element being encoded. * @param elGetter A function that can be used to get new ASN.1 elements. * @returns {_Element} The CertificateSet, encoded as an ASN.1 Element. */ export function _encode_CertificateSet(value, elGetter) { if (!_cached_encoder_for_CertificateSet) { _cached_encoder_for_CertificateSet = $._encodeSetOf(() => _encode_CertificateChoices, $.BER); } return _cached_encoder_for_CertificateSet(value, elGetter); } /* eslint-enable */