@wildboar/pki-stub
Version:
X.510 PKI-Stub ASN.1 data structures in TypeScript
33 lines (32 loc) • 1.37 kB
JavaScript
import * as $ from "@wildboar/asn1/functional";
import { _decode_ExtensionAttribute, _encode_ExtensionAttribute, } from "../PkiPmiExternalDataTypes/ExtensionAttribute.ta.mjs";
let _cached_decoder_for_ExtensionAttributes = null;
/**
* @summary Decodes an ASN.1 element into a(n) ExtensionAttributes
* @function
* @param {_Element} el The element being decoded.
* @returns {ExtensionAttributes} The decoded data structure.
*/
export function _decode_ExtensionAttributes(el) {
if (!_cached_decoder_for_ExtensionAttributes) {
_cached_decoder_for_ExtensionAttributes =
$._decodeSetOf(() => _decode_ExtensionAttribute);
}
return _cached_decoder_for_ExtensionAttributes(el);
}
let _cached_encoder_for_ExtensionAttributes = null;
/**
* @summary Encodes a(n) ExtensionAttributes 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 ExtensionAttributes, encoded as an ASN.1 Element.
*/
export function _encode_ExtensionAttributes(value, elGetter) {
if (!_cached_encoder_for_ExtensionAttributes) {
_cached_encoder_for_ExtensionAttributes =
$._encodeSetOf(() => _encode_ExtensionAttribute, $.BER);
}
return _cached_encoder_for_ExtensionAttributes(value, elGetter);
}
/* eslint-enable */