@wildboar/pki-stub
Version:
X.510 PKI-Stub ASN.1 data structures in TypeScript
33 lines (32 loc) • 1.2 kB
JavaScript
import { _get_decoder_for_SIGNED, _get_encoder_for_SIGNED, } from "../PKI-Stub/SIGNED.ta.mjs";
import { _decode_TBSCertAVL, _encode_TBSCertAVL, } from "../PKI-Stub/TBSCertAVL.ta.mjs";
let _cached_decoder_for_CertAVL = null;
/**
* @summary Decodes an ASN.1 element into a(n) CertAVL
* @function
* @param {_Element} el The element being decoded.
* @returns {CertAVL} The decoded data structure.
*/
export function _decode_CertAVL(el) {
if (!_cached_decoder_for_CertAVL) {
_cached_decoder_for_CertAVL =
_get_decoder_for_SIGNED(_decode_TBSCertAVL);
}
return _cached_decoder_for_CertAVL(el);
}
let _cached_encoder_for_CertAVL = null;
/**
* @summary Encodes a(n) CertAVL 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 CertAVL, encoded as an ASN.1 Element.
*/
export function _encode_CertAVL(value, elGetter) {
if (!_cached_encoder_for_CertAVL) {
_cached_encoder_for_CertAVL =
_get_encoder_for_SIGNED(_encode_TBSCertAVL);
}
return _cached_encoder_for_CertAVL(value, elGetter);
}
/* eslint-enable */