UNPKG

@wildboar/pkcs

Version:
31 lines (30 loc) 1.24 kB
import * as $ from "@wildboar/asn1/functional"; import { _decode_Attribute, _encode_Attribute, } from "../CryptographicMessageSyntax/Attribute.ta.mjs"; let _cached_decoder_for_AuthAttributes = null; /** * @summary Decodes an ASN.1 element into a(n) AuthAttributes * @function * @param {_Element} el The element being decoded. * @returns {AuthAttributes} The decoded data structure. */ export function _decode_AuthAttributes(el) { if (!_cached_decoder_for_AuthAttributes) { _cached_decoder_for_AuthAttributes = $._decodeSetOf(() => _decode_Attribute); } return _cached_decoder_for_AuthAttributes(el); } let _cached_encoder_for_AuthAttributes = null; /** * @summary Encodes a(n) AuthAttributes 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 AuthAttributes, encoded as an ASN.1 Element. */ export function _encode_AuthAttributes(value, elGetter) { if (!_cached_encoder_for_AuthAttributes) { _cached_encoder_for_AuthAttributes = $._encodeSetOf(() => _encode_Attribute, $.BER); } return _cached_encoder_for_AuthAttributes(value, elGetter); } /* eslint-enable */