UNPKG

@wildboar/pkcs

Version:
68 lines 4.64 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports._encode_KeyAgreeRecipientIdentifier = exports._decode_KeyAgreeRecipientIdentifier = exports._encode_RecipientKeyIdentifier = exports._decode_RecipientKeyIdentifier = exports.RecipientKeyIdentifier = exports._encode_IssuerAndSerialNumber = exports._decode_IssuerAndSerialNumber = exports.IssuerAndSerialNumber = void 0; /* eslint-disable */ const asn1_ts_1 = require("asn1-ts"); const $ = require("asn1-ts/dist/node/functional"); const IssuerAndSerialNumber_ta_1 = require("../CryptographicMessageSyntax/IssuerAndSerialNumber.ta"); const RecipientKeyIdentifier_ta_1 = require("../CryptographicMessageSyntax/RecipientKeyIdentifier.ta"); var IssuerAndSerialNumber_ta_2 = require("../CryptographicMessageSyntax/IssuerAndSerialNumber.ta"); Object.defineProperty(exports, "IssuerAndSerialNumber", { enumerable: true, get: function () { return IssuerAndSerialNumber_ta_2.IssuerAndSerialNumber; } }); Object.defineProperty(exports, "_decode_IssuerAndSerialNumber", { enumerable: true, get: function () { return IssuerAndSerialNumber_ta_2._decode_IssuerAndSerialNumber; } }); Object.defineProperty(exports, "_encode_IssuerAndSerialNumber", { enumerable: true, get: function () { return IssuerAndSerialNumber_ta_2._encode_IssuerAndSerialNumber; } }); var RecipientKeyIdentifier_ta_2 = require("../CryptographicMessageSyntax/RecipientKeyIdentifier.ta"); Object.defineProperty(exports, "RecipientKeyIdentifier", { enumerable: true, get: function () { return RecipientKeyIdentifier_ta_2.RecipientKeyIdentifier; } }); Object.defineProperty(exports, "_decode_RecipientKeyIdentifier", { enumerable: true, get: function () { return RecipientKeyIdentifier_ta_2._decode_RecipientKeyIdentifier; } }); Object.defineProperty(exports, "_encode_RecipientKeyIdentifier", { enumerable: true, get: function () { return RecipientKeyIdentifier_ta_2._encode_RecipientKeyIdentifier; } }); /* END_OF_SYMBOL_DEFINITION KeyAgreeRecipientIdentifier */ /* START_OF_SYMBOL_DEFINITION _cached_decoder_for_KeyAgreeRecipientIdentifier */ let _cached_decoder_for_KeyAgreeRecipientIdentifier = null; /* END_OF_SYMBOL_DEFINITION _cached_decoder_for_KeyAgreeRecipientIdentifier */ /* START_OF_SYMBOL_DEFINITION _decode_KeyAgreeRecipientIdentifier */ /** * @summary Decodes an ASN.1 element into a(n) KeyAgreeRecipientIdentifier * @function * @param {_Element} el The element being decoded. * @returns {KeyAgreeRecipientIdentifier} The decoded data structure. */ function _decode_KeyAgreeRecipientIdentifier(el) { if (!_cached_decoder_for_KeyAgreeRecipientIdentifier) { _cached_decoder_for_KeyAgreeRecipientIdentifier = $._decode_inextensible_choice({ "UNIVERSAL 16": [ "issuerAndSerialNumber", IssuerAndSerialNumber_ta_1._decode_IssuerAndSerialNumber, ], "CONTEXT 0": [ "rKeyId", $._decode_implicit(() => RecipientKeyIdentifier_ta_1._decode_RecipientKeyIdentifier), ], }); } return _cached_decoder_for_KeyAgreeRecipientIdentifier(el); } exports._decode_KeyAgreeRecipientIdentifier = _decode_KeyAgreeRecipientIdentifier; /* END_OF_SYMBOL_DEFINITION _decode_KeyAgreeRecipientIdentifier */ /* START_OF_SYMBOL_DEFINITION _cached_encoder_for_KeyAgreeRecipientIdentifier */ let _cached_encoder_for_KeyAgreeRecipientIdentifier = null; /* END_OF_SYMBOL_DEFINITION _cached_encoder_for_KeyAgreeRecipientIdentifier */ /* START_OF_SYMBOL_DEFINITION _encode_KeyAgreeRecipientIdentifier */ /** * @summary Encodes a(n) KeyAgreeRecipientIdentifier 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 KeyAgreeRecipientIdentifier, encoded as an ASN.1 Element. */ function _encode_KeyAgreeRecipientIdentifier(value, elGetter) { if (!_cached_encoder_for_KeyAgreeRecipientIdentifier) { _cached_encoder_for_KeyAgreeRecipientIdentifier = $._encode_choice({ issuerAndSerialNumber: IssuerAndSerialNumber_ta_1._encode_IssuerAndSerialNumber, rKeyId: $._encode_implicit(asn1_ts_1.ASN1TagClass.context, 0, () => RecipientKeyIdentifier_ta_1._encode_RecipientKeyIdentifier, $.BER), }, $.BER); } return _cached_encoder_for_KeyAgreeRecipientIdentifier(value, elGetter); } exports._encode_KeyAgreeRecipientIdentifier = _encode_KeyAgreeRecipientIdentifier; /* END_OF_SYMBOL_DEFINITION _encode_KeyAgreeRecipientIdentifier */ /* eslint-enable */ //# sourceMappingURL=KeyAgreeRecipientIdentifier.ta.js.map