@wildboar/pkcs
Version:
Public Key Cryptography Standard PDUs in TypeScript
31 lines (30 loc) • 1.28 kB
JavaScript
import * as $ from "@wildboar/asn1/functional";
import { _decode_ContentInfo, _encode_ContentInfo, } from "../PKCS7/ContentInfo.ta.mjs";
let _cached_decoder_for_AuthenticatedSafe = null;
/**
* @summary Decodes an ASN.1 element into a(n) AuthenticatedSafe
* @function
* @param {_Element} el The element being decoded.
* @returns {AuthenticatedSafe} The decoded data structure.
*/
export function _decode_AuthenticatedSafe(el) {
if (!_cached_decoder_for_AuthenticatedSafe) {
_cached_decoder_for_AuthenticatedSafe = $._decodeSequenceOf(() => _decode_ContentInfo);
}
return _cached_decoder_for_AuthenticatedSafe(el);
}
let _cached_encoder_for_AuthenticatedSafe = null;
/**
* @summary Encodes a(n) AuthenticatedSafe 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 AuthenticatedSafe, encoded as an ASN.1 Element.
*/
export function _encode_AuthenticatedSafe(value, elGetter) {
if (!_cached_encoder_for_AuthenticatedSafe) {
_cached_encoder_for_AuthenticatedSafe = $._encodeSequenceOf(() => _encode_ContentInfo, $.BER);
}
return _cached_encoder_for_AuthenticatedSafe(value, elGetter);
}
/* eslint-enable */