UNPKG

@wildboar/pkcs

Version:
30 lines (29 loc) 1.45 kB
import { _decode_AlgorithmIdentifier, _encode_AlgorithmIdentifier, } from "@wildboar/x500/AuthenticationFramework"; let _cached_decoder_for_MessageAuthenticationCodeAlgorithm = null; /** * @summary Decodes an ASN.1 element into a(n) MessageAuthenticationCodeAlgorithm * @function * @param {_Element} el The element being decoded. * @returns {MessageAuthenticationCodeAlgorithm} The decoded data structure. */ export function _decode_MessageAuthenticationCodeAlgorithm(el) { if (!_cached_decoder_for_MessageAuthenticationCodeAlgorithm) { _cached_decoder_for_MessageAuthenticationCodeAlgorithm = _decode_AlgorithmIdentifier; } return _cached_decoder_for_MessageAuthenticationCodeAlgorithm(el); } let _cached_encoder_for_MessageAuthenticationCodeAlgorithm = null; /** * @summary Encodes a(n) MessageAuthenticationCodeAlgorithm 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 MessageAuthenticationCodeAlgorithm, encoded as an ASN.1 Element. */ export function _encode_MessageAuthenticationCodeAlgorithm(value, elGetter) { if (!_cached_encoder_for_MessageAuthenticationCodeAlgorithm) { _cached_encoder_for_MessageAuthenticationCodeAlgorithm = _encode_AlgorithmIdentifier; } return _cached_encoder_for_MessageAuthenticationCodeAlgorithm(value, elGetter); } /* eslint-enable */