UNPKG

@wildboar/pkcs

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