@wildboar/pkcs
Version:
Public Key Cryptography Standard PDUs in TypeScript
69 lines • 3.56 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports._encode_SecurityCondition = exports._decode_SecurityCondition = exports._encode_Identifier = exports._decode_Identifier = void 0;
/* eslint-disable */
const asn1_ts_1 = require("asn1-ts");
const $ = require("asn1-ts/dist/node/functional");
const Identifier_ta_1 = require("../PKCS-15/Identifier.ta");
var Identifier_ta_2 = require("../PKCS-15/Identifier.ta");
Object.defineProperty(exports, "_decode_Identifier", { enumerable: true, get: function () { return Identifier_ta_2._decode_Identifier; } });
Object.defineProperty(exports, "_encode_Identifier", { enumerable: true, get: function () { return Identifier_ta_2._encode_Identifier; } });
/* END_OF_SYMBOL_DEFINITION SecurityCondition */
/* START_OF_SYMBOL_DEFINITION _cached_decoder_for_SecurityCondition */
let _cached_decoder_for_SecurityCondition = null;
/* END_OF_SYMBOL_DEFINITION _cached_decoder_for_SecurityCondition */
/* START_OF_SYMBOL_DEFINITION _decode_SecurityCondition */
/**
* @summary Decodes an ASN.1 element into a(n) SecurityCondition
* @function
* @param {_Element} el The element being decoded.
* @returns {SecurityCondition} The decoded data structure.
*/
function _decode_SecurityCondition(el) {
if (!_cached_decoder_for_SecurityCondition) {
_cached_decoder_for_SecurityCondition = $._decode_extensible_choice({
"UNIVERSAL 4": ["authId", Identifier_ta_1._decode_Identifier],
"CONTEXT 0": [
"not",
$._decode_explicit(() => _decode_SecurityCondition),
],
"CONTEXT 1": [
"and",
$._decode_implicit(() => $._decodeSequenceOf(() => _decode_SecurityCondition)),
],
"CONTEXT 2": [
"or",
$._decode_implicit(() => $._decodeSequenceOf(() => _decode_SecurityCondition)),
],
});
}
return _cached_decoder_for_SecurityCondition(el);
}
exports._decode_SecurityCondition = _decode_SecurityCondition;
/* END_OF_SYMBOL_DEFINITION _decode_SecurityCondition */
/* START_OF_SYMBOL_DEFINITION _cached_encoder_for_SecurityCondition */
let _cached_encoder_for_SecurityCondition = null;
/* END_OF_SYMBOL_DEFINITION _cached_encoder_for_SecurityCondition */
/* START_OF_SYMBOL_DEFINITION _encode_SecurityCondition */
/**
* @summary Encodes a(n) SecurityCondition into an ASN.1 Element.
* @function
* @param {value} el The element being decoded.
* @param elGetter A function that can be used to get new ASN.1 elements.
* @returns {_Element} The SecurityCondition, encoded as an ASN.1 Element.
*/
function _encode_SecurityCondition(value, elGetter) {
if (!_cached_encoder_for_SecurityCondition) {
_cached_encoder_for_SecurityCondition = $._encode_choice({
authId: Identifier_ta_1._encode_Identifier,
not: $._encode_explicit(asn1_ts_1.ASN1TagClass.context, 0, () => _encode_SecurityCondition, $.BER),
and: $._encode_implicit(asn1_ts_1.ASN1TagClass.context, 1, () => $._encodeSequenceOf(() => _encode_SecurityCondition, $.BER), $.BER),
or: $._encode_implicit(asn1_ts_1.ASN1TagClass.context, 2, () => $._encodeSequenceOf(() => _encode_SecurityCondition, $.BER), $.BER),
}, $.BER);
}
return _cached_encoder_for_SecurityCondition(value, elGetter);
}
exports._encode_SecurityCondition = _encode_SecurityCondition;
/* END_OF_SYMBOL_DEFINITION _encode_SecurityCondition */
/* eslint-enable */
//# sourceMappingURL=SecurityCondition.ta.js.map