UNPKG

@wildboar/pkcs

Version:
102 lines 8.79 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports._encode_PrivateKeyType = exports._decode_PrivateKeyType = exports._encode_PrivateRSAKeyAttributes = exports._decode_PrivateRSAKeyAttributes = exports.PrivateRSAKeyAttributes = exports._get_encoder_for_PrivateKeyObject = exports._get_decoder_for_PrivateKeyObject = exports._encode_PrivateKEAKeyAttributes = exports._decode_PrivateKEAKeyAttributes = exports.PrivateKEAKeyAttributes = exports._encode_PrivateECKeyAttributes = exports._decode_PrivateECKeyAttributes = exports.PrivateECKeyAttributes = exports._encode_PrivateDSAKeyAttributes = exports._decode_PrivateDSAKeyAttributes = exports.PrivateDSAKeyAttributes = exports._encode_PrivateDHKeyAttributes = exports._decode_PrivateDHKeyAttributes = exports.PrivateDHKeyAttributes = void 0; /* eslint-disable */ const asn1_ts_1 = require("asn1-ts"); const $ = require("asn1-ts/dist/node/functional"); const PrivateDHKeyAttributes_ta_1 = require("../PKCS-15/PrivateDHKeyAttributes.ta"); const PrivateDSAKeyAttributes_ta_1 = require("../PKCS-15/PrivateDSAKeyAttributes.ta"); const PrivateECKeyAttributes_ta_1 = require("../PKCS-15/PrivateECKeyAttributes.ta"); const PrivateKEAKeyAttributes_ta_1 = require("../PKCS-15/PrivateKEAKeyAttributes.ta"); const PrivateKeyObject_ta_1 = require("../PKCS-15/PrivateKeyObject.ta"); const PrivateRSAKeyAttributes_ta_1 = require("../PKCS-15/PrivateRSAKeyAttributes.ta"); var PrivateDHKeyAttributes_ta_2 = require("../PKCS-15/PrivateDHKeyAttributes.ta"); Object.defineProperty(exports, "PrivateDHKeyAttributes", { enumerable: true, get: function () { return PrivateDHKeyAttributes_ta_2.PrivateDHKeyAttributes; } }); Object.defineProperty(exports, "_decode_PrivateDHKeyAttributes", { enumerable: true, get: function () { return PrivateDHKeyAttributes_ta_2._decode_PrivateDHKeyAttributes; } }); Object.defineProperty(exports, "_encode_PrivateDHKeyAttributes", { enumerable: true, get: function () { return PrivateDHKeyAttributes_ta_2._encode_PrivateDHKeyAttributes; } }); var PrivateDSAKeyAttributes_ta_2 = require("../PKCS-15/PrivateDSAKeyAttributes.ta"); Object.defineProperty(exports, "PrivateDSAKeyAttributes", { enumerable: true, get: function () { return PrivateDSAKeyAttributes_ta_2.PrivateDSAKeyAttributes; } }); Object.defineProperty(exports, "_decode_PrivateDSAKeyAttributes", { enumerable: true, get: function () { return PrivateDSAKeyAttributes_ta_2._decode_PrivateDSAKeyAttributes; } }); Object.defineProperty(exports, "_encode_PrivateDSAKeyAttributes", { enumerable: true, get: function () { return PrivateDSAKeyAttributes_ta_2._encode_PrivateDSAKeyAttributes; } }); var PrivateECKeyAttributes_ta_2 = require("../PKCS-15/PrivateECKeyAttributes.ta"); Object.defineProperty(exports, "PrivateECKeyAttributes", { enumerable: true, get: function () { return PrivateECKeyAttributes_ta_2.PrivateECKeyAttributes; } }); Object.defineProperty(exports, "_decode_PrivateECKeyAttributes", { enumerable: true, get: function () { return PrivateECKeyAttributes_ta_2._decode_PrivateECKeyAttributes; } }); Object.defineProperty(exports, "_encode_PrivateECKeyAttributes", { enumerable: true, get: function () { return PrivateECKeyAttributes_ta_2._encode_PrivateECKeyAttributes; } }); var PrivateKEAKeyAttributes_ta_2 = require("../PKCS-15/PrivateKEAKeyAttributes.ta"); Object.defineProperty(exports, "PrivateKEAKeyAttributes", { enumerable: true, get: function () { return PrivateKEAKeyAttributes_ta_2.PrivateKEAKeyAttributes; } }); Object.defineProperty(exports, "_decode_PrivateKEAKeyAttributes", { enumerable: true, get: function () { return PrivateKEAKeyAttributes_ta_2._decode_PrivateKEAKeyAttributes; } }); Object.defineProperty(exports, "_encode_PrivateKEAKeyAttributes", { enumerable: true, get: function () { return PrivateKEAKeyAttributes_ta_2._encode_PrivateKEAKeyAttributes; } }); var PrivateKeyObject_ta_2 = require("../PKCS-15/PrivateKeyObject.ta"); Object.defineProperty(exports, "_get_decoder_for_PrivateKeyObject", { enumerable: true, get: function () { return PrivateKeyObject_ta_2._get_decoder_for_PrivateKeyObject; } }); Object.defineProperty(exports, "_get_encoder_for_PrivateKeyObject", { enumerable: true, get: function () { return PrivateKeyObject_ta_2._get_encoder_for_PrivateKeyObject; } }); var PrivateRSAKeyAttributes_ta_2 = require("../PKCS-15/PrivateRSAKeyAttributes.ta"); Object.defineProperty(exports, "PrivateRSAKeyAttributes", { enumerable: true, get: function () { return PrivateRSAKeyAttributes_ta_2.PrivateRSAKeyAttributes; } }); Object.defineProperty(exports, "_decode_PrivateRSAKeyAttributes", { enumerable: true, get: function () { return PrivateRSAKeyAttributes_ta_2._decode_PrivateRSAKeyAttributes; } }); Object.defineProperty(exports, "_encode_PrivateRSAKeyAttributes", { enumerable: true, get: function () { return PrivateRSAKeyAttributes_ta_2._encode_PrivateRSAKeyAttributes; } }); /* END_OF_SYMBOL_DEFINITION PrivateKeyType */ /* START_OF_SYMBOL_DEFINITION _cached_decoder_for_PrivateKeyType */ let _cached_decoder_for_PrivateKeyType = null; /* END_OF_SYMBOL_DEFINITION _cached_decoder_for_PrivateKeyType */ /* START_OF_SYMBOL_DEFINITION _decode_PrivateKeyType */ /** * @summary Decodes an ASN.1 element into a(n) PrivateKeyType * @function * @param {_Element} el The element being decoded. * @returns {PrivateKeyType} The decoded data structure. */ function _decode_PrivateKeyType(el) { if (!_cached_decoder_for_PrivateKeyType) { _cached_decoder_for_PrivateKeyType = $._decode_extensible_choice({ "UNIVERSAL 16": [ "privateRSAKey", PrivateKeyObject_ta_1._get_decoder_for_PrivateKeyObject(PrivateRSAKeyAttributes_ta_1._decode_PrivateRSAKeyAttributes), ], "CONTEXT 0": [ "privateECKey", $._decode_implicit(() => PrivateKeyObject_ta_1._get_decoder_for_PrivateKeyObject(PrivateECKeyAttributes_ta_1._decode_PrivateECKeyAttributes)), ], "CONTEXT 1": [ "privateDHKey", $._decode_implicit(() => PrivateKeyObject_ta_1._get_decoder_for_PrivateKeyObject(PrivateDHKeyAttributes_ta_1._decode_PrivateDHKeyAttributes)), ], "CONTEXT 2": [ "privateDSAKey", $._decode_implicit(() => PrivateKeyObject_ta_1._get_decoder_for_PrivateKeyObject(PrivateDSAKeyAttributes_ta_1._decode_PrivateDSAKeyAttributes)), ], "CONTEXT 3": [ "privateKEAKey", $._decode_implicit(() => PrivateKeyObject_ta_1._get_decoder_for_PrivateKeyObject(PrivateKEAKeyAttributes_ta_1._decode_PrivateKEAKeyAttributes)), ], }); } return _cached_decoder_for_PrivateKeyType(el); } exports._decode_PrivateKeyType = _decode_PrivateKeyType; /* END_OF_SYMBOL_DEFINITION _decode_PrivateKeyType */ /* START_OF_SYMBOL_DEFINITION _cached_encoder_for_PrivateKeyType */ let _cached_encoder_for_PrivateKeyType = null; /* END_OF_SYMBOL_DEFINITION _cached_encoder_for_PrivateKeyType */ /* START_OF_SYMBOL_DEFINITION _encode_PrivateKeyType */ /** * @summary Encodes a(n) PrivateKeyType 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 PrivateKeyType, encoded as an ASN.1 Element. */ function _encode_PrivateKeyType(value, elGetter) { if (!_cached_encoder_for_PrivateKeyType) { _cached_encoder_for_PrivateKeyType = $._encode_choice({ privateRSAKey: PrivateKeyObject_ta_1._get_encoder_for_PrivateKeyObject(PrivateRSAKeyAttributes_ta_1._encode_PrivateRSAKeyAttributes), privateECKey: $._encode_implicit(asn1_ts_1.ASN1TagClass.context, 0, () => PrivateKeyObject_ta_1._get_encoder_for_PrivateKeyObject(PrivateECKeyAttributes_ta_1._encode_PrivateECKeyAttributes), $.BER), privateDHKey: $._encode_implicit(asn1_ts_1.ASN1TagClass.context, 1, () => PrivateKeyObject_ta_1._get_encoder_for_PrivateKeyObject(PrivateDHKeyAttributes_ta_1._encode_PrivateDHKeyAttributes), $.BER), privateDSAKey: $._encode_implicit(asn1_ts_1.ASN1TagClass.context, 2, () => PrivateKeyObject_ta_1._get_encoder_for_PrivateKeyObject(PrivateDSAKeyAttributes_ta_1._encode_PrivateDSAKeyAttributes), $.BER), privateKEAKey: $._encode_implicit(asn1_ts_1.ASN1TagClass.context, 3, () => PrivateKeyObject_ta_1._get_encoder_for_PrivateKeyObject(PrivateKEAKeyAttributes_ta_1._encode_PrivateKEAKeyAttributes), $.BER), }, $.BER); } return _cached_encoder_for_PrivateKeyType(value, elGetter); } exports._encode_PrivateKeyType = _encode_PrivateKeyType; /* END_OF_SYMBOL_DEFINITION _encode_PrivateKeyType */ /* eslint-enable */ //# sourceMappingURL=PrivateKeyType.ta.js.map