UNPKG

@wildboar/pkcs

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