UNPKG

@wildboar/pkcs

Version:
31 lines (30 loc) 1.3 kB
import { _decode_CertificateType, _encode_CertificateType, } from "../PKCS-15/CertificateType.ta.mjs"; import { _get_decoder_for_PathOrObjects, _get_encoder_for_PathOrObjects, } from "../PKCS-15/PathOrObjects.ta.mjs"; let _cached_decoder_for_Certificates = null; /** * @summary Decodes an ASN.1 element into a(n) Certificates * @function * @param {_Element} el The element being decoded. * @returns {Certificates} The decoded data structure. */ export function _decode_Certificates(el) { if (!_cached_decoder_for_Certificates) { _cached_decoder_for_Certificates = _get_decoder_for_PathOrObjects(_decode_CertificateType); } return _cached_decoder_for_Certificates(el); } let _cached_encoder_for_Certificates = null; /** * @summary Encodes a(n) Certificates 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 Certificates, encoded as an ASN.1 Element. */ export function _encode_Certificates(value, elGetter) { if (!_cached_encoder_for_Certificates) { _cached_encoder_for_Certificates = _get_encoder_for_PathOrObjects(_encode_CertificateType); } return _cached_encoder_for_Certificates(value, elGetter); } /* eslint-enable */