@wildboar/pkcs
Version:
Public Key Cryptography Standard PDUs in TypeScript
31 lines (30 loc) • 1.42 kB
JavaScript
import { _get_decoder_for_SIGNED, _get_encoder_for_SIGNED, } from "@wildboar/x500/AuthenticationFramework";
import { _decode_ExtendedCertificateInfo, _encode_ExtendedCertificateInfo, } from "../PKCS7/ExtendedCertificateInfo.ta.mjs";
let _cached_decoder_for_ExtendedCertificate = null;
/**
* @summary Decodes an ASN.1 element into a(n) ExtendedCertificate
* @function
* @param {_Element} el The element being decoded.
* @returns {ExtendedCertificate} The decoded data structure.
*/
export function _decode_ExtendedCertificate(el) {
if (!_cached_decoder_for_ExtendedCertificate) {
_cached_decoder_for_ExtendedCertificate = _get_decoder_for_SIGNED(_decode_ExtendedCertificateInfo);
}
return _cached_decoder_for_ExtendedCertificate(el);
}
let _cached_encoder_for_ExtendedCertificate = null;
/**
* @summary Encodes a(n) ExtendedCertificate 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 ExtendedCertificate, encoded as an ASN.1 Element.
*/
export function _encode_ExtendedCertificate(value, elGetter) {
if (!_cached_encoder_for_ExtendedCertificate) {
_cached_encoder_for_ExtendedCertificate = _get_encoder_for_SIGNED(_encode_ExtendedCertificateInfo);
}
return _cached_encoder_for_ExtendedCertificate(value, elGetter);
}
/* eslint-enable */