UNPKG

@wildboar/pkcs

Version:
102 lines 8.62 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports._encode_PublicKeyType = exports._decode_PublicKeyType = exports._encode_PublicRSAKeyAttributes = exports._decode_PublicRSAKeyAttributes = exports.PublicRSAKeyAttributes = exports._get_encoder_for_PublicKeyObject = exports._get_decoder_for_PublicKeyObject = exports._encode_PublicKEAKeyAttributes = exports._decode_PublicKEAKeyAttributes = exports.PublicKEAKeyAttributes = exports._encode_PublicECKeyAttributes = exports._decode_PublicECKeyAttributes = exports.PublicECKeyAttributes = exports._encode_PublicDSAKeyAttributes = exports._decode_PublicDSAKeyAttributes = exports.PublicDSAKeyAttributes = exports._encode_PublicDHKeyAttributes = exports._decode_PublicDHKeyAttributes = exports.PublicDHKeyAttributes = void 0; /* eslint-disable */ const asn1_ts_1 = require("asn1-ts"); const $ = require("asn1-ts/dist/node/functional"); const PublicDHKeyAttributes_ta_1 = require("../PKCS-15/PublicDHKeyAttributes.ta"); const PublicDSAKeyAttributes_ta_1 = require("../PKCS-15/PublicDSAKeyAttributes.ta"); const PublicECKeyAttributes_ta_1 = require("../PKCS-15/PublicECKeyAttributes.ta"); const PublicKEAKeyAttributes_ta_1 = require("../PKCS-15/PublicKEAKeyAttributes.ta"); const PublicKeyObject_ta_1 = require("../PKCS-15/PublicKeyObject.ta"); const PublicRSAKeyAttributes_ta_1 = require("../PKCS-15/PublicRSAKeyAttributes.ta"); var PublicDHKeyAttributes_ta_2 = require("../PKCS-15/PublicDHKeyAttributes.ta"); Object.defineProperty(exports, "PublicDHKeyAttributes", { enumerable: true, get: function () { return PublicDHKeyAttributes_ta_2.PublicDHKeyAttributes; } }); Object.defineProperty(exports, "_decode_PublicDHKeyAttributes", { enumerable: true, get: function () { return PublicDHKeyAttributes_ta_2._decode_PublicDHKeyAttributes; } }); Object.defineProperty(exports, "_encode_PublicDHKeyAttributes", { enumerable: true, get: function () { return PublicDHKeyAttributes_ta_2._encode_PublicDHKeyAttributes; } }); var PublicDSAKeyAttributes_ta_2 = require("../PKCS-15/PublicDSAKeyAttributes.ta"); Object.defineProperty(exports, "PublicDSAKeyAttributes", { enumerable: true, get: function () { return PublicDSAKeyAttributes_ta_2.PublicDSAKeyAttributes; } }); Object.defineProperty(exports, "_decode_PublicDSAKeyAttributes", { enumerable: true, get: function () { return PublicDSAKeyAttributes_ta_2._decode_PublicDSAKeyAttributes; } }); Object.defineProperty(exports, "_encode_PublicDSAKeyAttributes", { enumerable: true, get: function () { return PublicDSAKeyAttributes_ta_2._encode_PublicDSAKeyAttributes; } }); var PublicECKeyAttributes_ta_2 = require("../PKCS-15/PublicECKeyAttributes.ta"); Object.defineProperty(exports, "PublicECKeyAttributes", { enumerable: true, get: function () { return PublicECKeyAttributes_ta_2.PublicECKeyAttributes; } }); Object.defineProperty(exports, "_decode_PublicECKeyAttributes", { enumerable: true, get: function () { return PublicECKeyAttributes_ta_2._decode_PublicECKeyAttributes; } }); Object.defineProperty(exports, "_encode_PublicECKeyAttributes", { enumerable: true, get: function () { return PublicECKeyAttributes_ta_2._encode_PublicECKeyAttributes; } }); var PublicKEAKeyAttributes_ta_2 = require("../PKCS-15/PublicKEAKeyAttributes.ta"); Object.defineProperty(exports, "PublicKEAKeyAttributes", { enumerable: true, get: function () { return PublicKEAKeyAttributes_ta_2.PublicKEAKeyAttributes; } }); Object.defineProperty(exports, "_decode_PublicKEAKeyAttributes", { enumerable: true, get: function () { return PublicKEAKeyAttributes_ta_2._decode_PublicKEAKeyAttributes; } }); Object.defineProperty(exports, "_encode_PublicKEAKeyAttributes", { enumerable: true, get: function () { return PublicKEAKeyAttributes_ta_2._encode_PublicKEAKeyAttributes; } }); var PublicKeyObject_ta_2 = require("../PKCS-15/PublicKeyObject.ta"); Object.defineProperty(exports, "_get_decoder_for_PublicKeyObject", { enumerable: true, get: function () { return PublicKeyObject_ta_2._get_decoder_for_PublicKeyObject; } }); Object.defineProperty(exports, "_get_encoder_for_PublicKeyObject", { enumerable: true, get: function () { return PublicKeyObject_ta_2._get_encoder_for_PublicKeyObject; } }); var PublicRSAKeyAttributes_ta_2 = require("../PKCS-15/PublicRSAKeyAttributes.ta"); Object.defineProperty(exports, "PublicRSAKeyAttributes", { enumerable: true, get: function () { return PublicRSAKeyAttributes_ta_2.PublicRSAKeyAttributes; } }); Object.defineProperty(exports, "_decode_PublicRSAKeyAttributes", { enumerable: true, get: function () { return PublicRSAKeyAttributes_ta_2._decode_PublicRSAKeyAttributes; } }); Object.defineProperty(exports, "_encode_PublicRSAKeyAttributes", { enumerable: true, get: function () { return PublicRSAKeyAttributes_ta_2._encode_PublicRSAKeyAttributes; } }); /* END_OF_SYMBOL_DEFINITION PublicKeyType */ /* START_OF_SYMBOL_DEFINITION _cached_decoder_for_PublicKeyType */ let _cached_decoder_for_PublicKeyType = null; /* END_OF_SYMBOL_DEFINITION _cached_decoder_for_PublicKeyType */ /* START_OF_SYMBOL_DEFINITION _decode_PublicKeyType */ /** * @summary Decodes an ASN.1 element into a(n) PublicKeyType * @function * @param {_Element} el The element being decoded. * @returns {PublicKeyType} The decoded data structure. */ function _decode_PublicKeyType(el) { if (!_cached_decoder_for_PublicKeyType) { _cached_decoder_for_PublicKeyType = $._decode_extensible_choice({ "UNIVERSAL 16": [ "publicRSAKey", PublicKeyObject_ta_1._get_decoder_for_PublicKeyObject(PublicRSAKeyAttributes_ta_1._decode_PublicRSAKeyAttributes), ], "CONTEXT 0": [ "publicECKey", $._decode_implicit(() => PublicKeyObject_ta_1._get_decoder_for_PublicKeyObject(PublicECKeyAttributes_ta_1._decode_PublicECKeyAttributes)), ], "CONTEXT 1": [ "publicDHKey", $._decode_implicit(() => PublicKeyObject_ta_1._get_decoder_for_PublicKeyObject(PublicDHKeyAttributes_ta_1._decode_PublicDHKeyAttributes)), ], "CONTEXT 2": [ "publicDSAKey", $._decode_implicit(() => PublicKeyObject_ta_1._get_decoder_for_PublicKeyObject(PublicDSAKeyAttributes_ta_1._decode_PublicDSAKeyAttributes)), ], "CONTEXT 3": [ "publicKEAKey", $._decode_implicit(() => PublicKeyObject_ta_1._get_decoder_for_PublicKeyObject(PublicKEAKeyAttributes_ta_1._decode_PublicKEAKeyAttributes)), ], }); } return _cached_decoder_for_PublicKeyType(el); } exports._decode_PublicKeyType = _decode_PublicKeyType; /* END_OF_SYMBOL_DEFINITION _decode_PublicKeyType */ /* START_OF_SYMBOL_DEFINITION _cached_encoder_for_PublicKeyType */ let _cached_encoder_for_PublicKeyType = null; /* END_OF_SYMBOL_DEFINITION _cached_encoder_for_PublicKeyType */ /* START_OF_SYMBOL_DEFINITION _encode_PublicKeyType */ /** * @summary Encodes a(n) PublicKeyType 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 PublicKeyType, encoded as an ASN.1 Element. */ function _encode_PublicKeyType(value, elGetter) { if (!_cached_encoder_for_PublicKeyType) { _cached_encoder_for_PublicKeyType = $._encode_choice({ publicRSAKey: PublicKeyObject_ta_1._get_encoder_for_PublicKeyObject(PublicRSAKeyAttributes_ta_1._encode_PublicRSAKeyAttributes), publicECKey: $._encode_implicit(asn1_ts_1.ASN1TagClass.context, 0, () => PublicKeyObject_ta_1._get_encoder_for_PublicKeyObject(PublicECKeyAttributes_ta_1._encode_PublicECKeyAttributes), $.BER), publicDHKey: $._encode_implicit(asn1_ts_1.ASN1TagClass.context, 1, () => PublicKeyObject_ta_1._get_encoder_for_PublicKeyObject(PublicDHKeyAttributes_ta_1._encode_PublicDHKeyAttributes), $.BER), publicDSAKey: $._encode_implicit(asn1_ts_1.ASN1TagClass.context, 2, () => PublicKeyObject_ta_1._get_encoder_for_PublicKeyObject(PublicDSAKeyAttributes_ta_1._encode_PublicDSAKeyAttributes), $.BER), publicKEAKey: $._encode_implicit(asn1_ts_1.ASN1TagClass.context, 3, () => PublicKeyObject_ta_1._get_encoder_for_PublicKeyObject(PublicKEAKeyAttributes_ta_1._encode_PublicKEAKeyAttributes), $.BER), }, $.BER); } return _cached_encoder_for_PublicKeyType(value, elGetter); } exports._encode_PublicKeyType = _encode_PublicKeyType; /* END_OF_SYMBOL_DEFINITION _encode_PublicKeyType */ /* eslint-enable */ //# sourceMappingURL=PublicKeyType.ta.js.map