UNPKG

@wildboar/pki-stub

Version:
31 lines (30 loc) 1.14 kB
import * as $ from "@wildboar/asn1/functional"; import { _decode_Certificate, _encode_Certificate, } from "../PKI-Stub/Certificate.ta.mjs"; let _cached_decoder_for_PkiPath = null; /** * @summary Decodes an ASN.1 element into a(n) PkiPath * @function * @param {_Element} el The element being decoded. * @returns {PkiPath} The decoded data structure. */ export function _decode_PkiPath(el) { if (!_cached_decoder_for_PkiPath) { _cached_decoder_for_PkiPath = $._decodeSequenceOf(() => _decode_Certificate); } return _cached_decoder_for_PkiPath(el); } let _cached_encoder_for_PkiPath = null; /** * @summary Encodes a(n) PkiPath 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 PkiPath, encoded as an ASN.1 Element. */ export function _encode_PkiPath(value, elGetter) { if (!_cached_encoder_for_PkiPath) { _cached_encoder_for_PkiPath = $._encodeSequenceOf(() => _encode_Certificate, $.BER); } return _cached_encoder_for_PkiPath(value, elGetter); } /* eslint-enable */