@wildboar/pkcs
Version:
Public Key Cryptography Standard PDUs in TypeScript
30 lines (29 loc) • 1.38 kB
JavaScript
import { _decode_AlgorithmIdentifier, _encode_AlgorithmIdentifier, } from "@wildboar/x500/AuthenticationFramework";
let _cached_decoder_for_EncryptionAlgorithmIdentifier = null;
/**
* @summary Decodes an ASN.1 element into a(n) EncryptionAlgorithmIdentifier
* @function
* @param {_Element} el The element being decoded.
* @returns {EncryptionAlgorithmIdentifier} The decoded data structure.
*/
export function _decode_EncryptionAlgorithmIdentifier(el) {
if (!_cached_decoder_for_EncryptionAlgorithmIdentifier) {
_cached_decoder_for_EncryptionAlgorithmIdentifier = _decode_AlgorithmIdentifier;
}
return _cached_decoder_for_EncryptionAlgorithmIdentifier(el);
}
let _cached_encoder_for_EncryptionAlgorithmIdentifier = null;
/**
* @summary Encodes a(n) EncryptionAlgorithmIdentifier 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 EncryptionAlgorithmIdentifier, encoded as an ASN.1 Element.
*/
export function _encode_EncryptionAlgorithmIdentifier(value, elGetter) {
if (!_cached_encoder_for_EncryptionAlgorithmIdentifier) {
_cached_encoder_for_EncryptionAlgorithmIdentifier = _encode_AlgorithmIdentifier;
}
return _cached_encoder_for_EncryptionAlgorithmIdentifier(value, elGetter);
}
/* eslint-enable */