UNPKG

@wildboar/pki-stub

Version:
45 lines (44 loc) 2.08 kB
/* eslint-disable */ import { ASN1TagClass as _TagClass, } from "@wildboar/asn1"; import * as $ from "@wildboar/asn1/functional"; import { _decode_PKCertIdentifier, _encode_PKCertIdentifier, } from "../PKI-Stub/PKCertIdentifier.ta.mjs"; import { _decode_DistinguishedName, _encode_DistinguishedName, } from "../PKI-Stub/DistinguishedName.ta.mjs"; let _cached_decoder_for_TBSCertAVL_entries_Item_idType = null; /** * @summary Decodes an ASN.1 element into a(n) TBSCertAVL_entries_Item_idType * @function * @param {_Element} el The element being decoded. * @returns {TBSCertAVL_entries_Item_idType} The decoded data structure. */ export function _decode_TBSCertAVL_entries_Item_idType(el) { if (!_cached_decoder_for_TBSCertAVL_entries_Item_idType) { _cached_decoder_for_TBSCertAVL_entries_Item_idType = $._decode_extensible_choice({ "CONTEXT 0": [ "certIdentifier", $._decode_explicit(() => _decode_PKCertIdentifier), ], "UNIVERSAL 16": ["entityGroup", _decode_DistinguishedName], }); } return _cached_decoder_for_TBSCertAVL_entries_Item_idType(el); } let _cached_encoder_for_TBSCertAVL_entries_Item_idType = null; /** * @summary Encodes a(n) TBSCertAVL_entries_Item_idType 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 TBSCertAVL_entries_Item_idType, encoded as an ASN.1 Element. */ export function _encode_TBSCertAVL_entries_Item_idType(value, elGetter) { if (!_cached_encoder_for_TBSCertAVL_entries_Item_idType) { _cached_encoder_for_TBSCertAVL_entries_Item_idType = $._encode_choice({ certIdentifier: $._encode_explicit(_TagClass.context, 0, () => _encode_PKCertIdentifier, $.BER), entityGroup: _encode_DistinguishedName, }, $.BER); } return _cached_encoder_for_TBSCertAVL_entries_Item_idType(value, elGetter); } /* eslint-enable */