UNPKG

pkcs-ts

Version:

PKCS #1 through #15 (Except #11) - Private and Public Keys, Certificates, and More

55 lines 4.7 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports._encode_RecipientInfo = exports._decode_RecipientInfo = exports._encode_KeyTransportRecipientInfo = exports._decode_KeyTransportRecipientInfo = exports.KeyTransportRecipientInfo = exports._encode_KeyEncryptionKeyRecipientInfo = exports._decode_KeyEncryptionKeyRecipientInfo = exports.KeyEncryptionKeyRecipientInfo = exports._encode_KeyAgreementRecipientInfo = exports._decode_KeyAgreementRecipientInfo = exports.KeyAgreementRecipientInfo = void 0; const tslib_1 = require("tslib"); const asn1_ts_1 = require("asn1-ts"); const $ = tslib_1.__importStar(require("asn1-ts/dist/node/functional")); const KeyAgreementRecipientInfo_ta_1 = require("../PKCS7/KeyAgreementRecipientInfo.ta"); const KeyEncryptionKeyRecipientInfo_ta_1 = require("../PKCS7/KeyEncryptionKeyRecipientInfo.ta"); const KeyTransportRecipientInfo_ta_1 = require("../PKCS7/KeyTransportRecipientInfo.ta"); var KeyAgreementRecipientInfo_ta_2 = require("../PKCS7/KeyAgreementRecipientInfo.ta"); Object.defineProperty(exports, "KeyAgreementRecipientInfo", { enumerable: true, get: function () { return KeyAgreementRecipientInfo_ta_2.KeyAgreementRecipientInfo; } }); Object.defineProperty(exports, "_decode_KeyAgreementRecipientInfo", { enumerable: true, get: function () { return KeyAgreementRecipientInfo_ta_2._decode_KeyAgreementRecipientInfo; } }); Object.defineProperty(exports, "_encode_KeyAgreementRecipientInfo", { enumerable: true, get: function () { return KeyAgreementRecipientInfo_ta_2._encode_KeyAgreementRecipientInfo; } }); var KeyEncryptionKeyRecipientInfo_ta_2 = require("../PKCS7/KeyEncryptionKeyRecipientInfo.ta"); Object.defineProperty(exports, "KeyEncryptionKeyRecipientInfo", { enumerable: true, get: function () { return KeyEncryptionKeyRecipientInfo_ta_2.KeyEncryptionKeyRecipientInfo; } }); Object.defineProperty(exports, "_decode_KeyEncryptionKeyRecipientInfo", { enumerable: true, get: function () { return KeyEncryptionKeyRecipientInfo_ta_2._decode_KeyEncryptionKeyRecipientInfo; } }); Object.defineProperty(exports, "_encode_KeyEncryptionKeyRecipientInfo", { enumerable: true, get: function () { return KeyEncryptionKeyRecipientInfo_ta_2._encode_KeyEncryptionKeyRecipientInfo; } }); var KeyTransportRecipientInfo_ta_2 = require("../PKCS7/KeyTransportRecipientInfo.ta"); Object.defineProperty(exports, "KeyTransportRecipientInfo", { enumerable: true, get: function () { return KeyTransportRecipientInfo_ta_2.KeyTransportRecipientInfo; } }); Object.defineProperty(exports, "_decode_KeyTransportRecipientInfo", { enumerable: true, get: function () { return KeyTransportRecipientInfo_ta_2._decode_KeyTransportRecipientInfo; } }); Object.defineProperty(exports, "_encode_KeyTransportRecipientInfo", { enumerable: true, get: function () { return KeyTransportRecipientInfo_ta_2._encode_KeyTransportRecipientInfo; } }); let _cached_decoder_for_RecipientInfo = null; function _decode_RecipientInfo(el) { if (!_cached_decoder_for_RecipientInfo) { _cached_decoder_for_RecipientInfo = $._decode_inextensible_choice({ "UNIVERSAL 16": [ "keyTransportRecipientInfo", KeyTransportRecipientInfo_ta_1._decode_KeyTransportRecipientInfo, ], "CONTEXT 1": [ "keyAgreementRecipientInfo", $._decode_implicit(() => KeyAgreementRecipientInfo_ta_1._decode_KeyAgreementRecipientInfo), ], "CONTEXT 2": [ "keyEncryptionKeyRecipientInfo", $._decode_implicit(() => KeyEncryptionKeyRecipientInfo_ta_1._decode_KeyEncryptionKeyRecipientInfo), ], }); } return _cached_decoder_for_RecipientInfo(el); } exports._decode_RecipientInfo = _decode_RecipientInfo; let _cached_encoder_for_RecipientInfo = null; function _encode_RecipientInfo(value, elGetter) { if (!_cached_encoder_for_RecipientInfo) { _cached_encoder_for_RecipientInfo = $._encode_choice({ keyTransportRecipientInfo: KeyTransportRecipientInfo_ta_1._encode_KeyTransportRecipientInfo, keyAgreementRecipientInfo: $._encode_implicit(asn1_ts_1.ASN1TagClass.context, 1, () => KeyAgreementRecipientInfo_ta_1._encode_KeyAgreementRecipientInfo, $.BER), keyEncryptionKeyRecipientInfo: $._encode_implicit(asn1_ts_1.ASN1TagClass.context, 2, () => KeyEncryptionKeyRecipientInfo_ta_1._encode_KeyEncryptionKeyRecipientInfo, $.BER), }, $.BER); } return _cached_encoder_for_RecipientInfo(value, elGetter); } exports._encode_RecipientInfo = _encode_RecipientInfo; //# sourceMappingURL=RecipientInfo.ta.js.map