@wildboar/pkcs
Version:
Public Key Cryptography Standard PDUs in TypeScript
68 lines • 4.71 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports._encode_KeyAgreementRecipientIdentifier = exports._decode_KeyAgreementRecipientIdentifier = 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("../PKCS7/IssuerAndSerialNumber.ta");
const RecipientKeyIdentifier_ta_1 = require("../PKCS7/RecipientKeyIdentifier.ta");
var IssuerAndSerialNumber_ta_2 = require("../PKCS7/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("../PKCS7/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 KeyAgreementRecipientIdentifier */
/* START_OF_SYMBOL_DEFINITION _cached_decoder_for_KeyAgreementRecipientIdentifier */
let _cached_decoder_for_KeyAgreementRecipientIdentifier = null;
/* END_OF_SYMBOL_DEFINITION _cached_decoder_for_KeyAgreementRecipientIdentifier */
/* START_OF_SYMBOL_DEFINITION _decode_KeyAgreementRecipientIdentifier */
/**
* @summary Decodes an ASN.1 element into a(n) KeyAgreementRecipientIdentifier
* @function
* @param {_Element} el The element being decoded.
* @returns {KeyAgreementRecipientIdentifier} The decoded data structure.
*/
function _decode_KeyAgreementRecipientIdentifier(el) {
if (!_cached_decoder_for_KeyAgreementRecipientIdentifier) {
_cached_decoder_for_KeyAgreementRecipientIdentifier = $._decode_inextensible_choice({
"UNIVERSAL 16": [
"issuerAndSerialNumber",
IssuerAndSerialNumber_ta_1._decode_IssuerAndSerialNumber,
],
"CONTEXT 0": [
"recipientKeyIdentifier",
$._decode_implicit(() => RecipientKeyIdentifier_ta_1._decode_RecipientKeyIdentifier),
],
});
}
return _cached_decoder_for_KeyAgreementRecipientIdentifier(el);
}
exports._decode_KeyAgreementRecipientIdentifier = _decode_KeyAgreementRecipientIdentifier;
/* END_OF_SYMBOL_DEFINITION _decode_KeyAgreementRecipientIdentifier */
/* START_OF_SYMBOL_DEFINITION _cached_encoder_for_KeyAgreementRecipientIdentifier */
let _cached_encoder_for_KeyAgreementRecipientIdentifier = null;
/* END_OF_SYMBOL_DEFINITION _cached_encoder_for_KeyAgreementRecipientIdentifier */
/* START_OF_SYMBOL_DEFINITION _encode_KeyAgreementRecipientIdentifier */
/**
* @summary Encodes a(n) KeyAgreementRecipientIdentifier 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 KeyAgreementRecipientIdentifier, encoded as an ASN.1 Element.
*/
function _encode_KeyAgreementRecipientIdentifier(value, elGetter) {
if (!_cached_encoder_for_KeyAgreementRecipientIdentifier) {
_cached_encoder_for_KeyAgreementRecipientIdentifier = $._encode_choice({
issuerAndSerialNumber: IssuerAndSerialNumber_ta_1._encode_IssuerAndSerialNumber,
recipientKeyIdentifier: $._encode_implicit(asn1_ts_1.ASN1TagClass.context, 0, () => RecipientKeyIdentifier_ta_1._encode_RecipientKeyIdentifier, $.BER),
}, $.BER);
}
return _cached_encoder_for_KeyAgreementRecipientIdentifier(value, elGetter);
}
exports._encode_KeyAgreementRecipientIdentifier = _encode_KeyAgreementRecipientIdentifier;
/* END_OF_SYMBOL_DEFINITION _encode_KeyAgreementRecipientIdentifier */
/* eslint-enable */
//# sourceMappingURL=KeyAgreementRecipientIdentifier.ta.js.map