UNPKG

@wildboar/pkcs

Version:
166 lines 7.01 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports._encode_IrisScan = exports._decode_IrisScan = exports._extension_additions_list_spec_for_IrisScan = exports._root_component_type_list_2_spec_for_IrisScan = exports._root_component_type_list_1_spec_for_IrisScan = exports.IrisScan = exports._enum_for_IrisScan_eye = exports._encode_IrisScan_eye = exports._decode_IrisScan_eye = exports.right = exports.left = exports.IrisScan_eye_right = exports.IrisScan_eye_left = exports.IrisScan_eye = void 0; /* eslint-disable */ const asn1_ts_1 = require("asn1-ts"); const $ = require("asn1-ts/dist/node/functional"); const IrisScan_eye_ta_1 = require("../PKCS-15/IrisScan-eye.ta"); var IrisScan_eye_ta_2 = require("../PKCS-15/IrisScan-eye.ta"); Object.defineProperty(exports, "IrisScan_eye", { enumerable: true, get: function () { return IrisScan_eye_ta_2.IrisScan_eye; } }); Object.defineProperty(exports, "IrisScan_eye_left", { enumerable: true, get: function () { return IrisScan_eye_ta_2.IrisScan_eye_left; } }); /* IMPORTED_LONG_ENUMERATION_ITEM */ Object.defineProperty(exports, "IrisScan_eye_right", { enumerable: true, get: function () { return IrisScan_eye_ta_2.IrisScan_eye_right; } }); /* IMPORTED_LONG_ENUMERATION_ITEM */ Object.defineProperty(exports, "left", { enumerable: true, get: function () { return IrisScan_eye_ta_2.left; } }); /* IMPORTED_SHORT_ENUMERATION_ITEM */ Object.defineProperty(exports, "right", { enumerable: true, get: function () { return IrisScan_eye_ta_2.right; } }); /* IMPORTED_SHORT_ENUMERATION_ITEM */ Object.defineProperty(exports, "_decode_IrisScan_eye", { enumerable: true, get: function () { return IrisScan_eye_ta_2._decode_IrisScan_eye; } }); Object.defineProperty(exports, "_encode_IrisScan_eye", { enumerable: true, get: function () { return IrisScan_eye_ta_2._encode_IrisScan_eye; } }); Object.defineProperty(exports, "_enum_for_IrisScan_eye", { enumerable: true, get: function () { return IrisScan_eye_ta_2._enum_for_IrisScan_eye; } }); /* START_OF_SYMBOL_DEFINITION IrisScan */ /** * @summary IrisScan * @description * * ### ASN.1 Definition: * * ```asn1 * IrisScan ::= SEQUENCE { * eye ENUMERATED {left, right}, * ... * } * ``` * * @class */ class IrisScan { constructor( /** * @summary `eye`. * @public * @readonly */ eye, /** * @summary Extensions that are not recognized. * @public * @readonly */ _unrecognizedExtensionsList = []) { this.eye = eye; this._unrecognizedExtensionsList = _unrecognizedExtensionsList; } /** * @summary Restructures an object into a IrisScan * @description * * This takes an `object` and converts it to a `IrisScan`. * * @public * @static * @method * @param {Object} _o An object having all of the keys and values of a `IrisScan`. * @returns {IrisScan} */ static _from_object(_o) { return new IrisScan(_o.eye, _o._unrecognizedExtensionsList); } } exports.IrisScan = IrisScan; /** * @summary The enum used as the type of the component `eye` * @public * @static */ IrisScan._enum_for_eye = IrisScan_eye_ta_1._enum_for_IrisScan_eye; /* END_OF_SYMBOL_DEFINITION IrisScan */ /* START_OF_SYMBOL_DEFINITION _root_component_type_list_1_spec_for_IrisScan */ /** * @summary The Leading Root Component Types of IrisScan * @description * * This is an array of `ComponentSpec`s that define how to decode the leading root component type list of a SET or SEQUENCE. * * @constant */ exports._root_component_type_list_1_spec_for_IrisScan = [ new $.ComponentSpec("eye", false, $.hasTag(asn1_ts_1.ASN1TagClass.universal, 10), undefined, undefined), ]; /* END_OF_SYMBOL_DEFINITION _root_component_type_list_1_spec_for_IrisScan */ /* START_OF_SYMBOL_DEFINITION _root_component_type_list_2_spec_for_IrisScan */ /** * @summary The Trailing Root Component Types of IrisScan * @description * * This is an array of `ComponentSpec`s that define how to decode the trailing root component type list of a SET or SEQUENCE. * * @constant */ exports._root_component_type_list_2_spec_for_IrisScan = []; /* END_OF_SYMBOL_DEFINITION _root_component_type_list_2_spec_for_IrisScan */ /* START_OF_SYMBOL_DEFINITION _extension_additions_list_spec_for_IrisScan */ /** * @summary The Extension Addition Component Types of IrisScan * @description * * This is an array of `ComponentSpec`s that define how to decode the extension addition component type list of a SET or SEQUENCE. * * @constant */ exports._extension_additions_list_spec_for_IrisScan = []; /* END_OF_SYMBOL_DEFINITION _extension_additions_list_spec_for_IrisScan */ /* START_OF_SYMBOL_DEFINITION _cached_decoder_for_IrisScan */ let _cached_decoder_for_IrisScan = null; /* END_OF_SYMBOL_DEFINITION _cached_decoder_for_IrisScan */ /* START_OF_SYMBOL_DEFINITION _decode_IrisScan */ /** * @summary Decodes an ASN.1 element into a(n) IrisScan * @function * @param {_Element} el The element being decoded. * @returns {IrisScan} The decoded data structure. */ function _decode_IrisScan(el) { if (!_cached_decoder_for_IrisScan) { _cached_decoder_for_IrisScan = function (el) { const sequence = el.sequence; if (sequence.length < 1) { throw new asn1_ts_1.ASN1ConstructionError("IrisScan contained only " + sequence.length.toString() + " elements."); } sequence[0].name = "eye"; let eye; eye = IrisScan_eye_ta_1._decode_IrisScan_eye(sequence[0]); return new IrisScan(eye, sequence.slice(1)); }; } return _cached_decoder_for_IrisScan(el); } exports._decode_IrisScan = _decode_IrisScan; /* END_OF_SYMBOL_DEFINITION _decode_IrisScan */ /* START_OF_SYMBOL_DEFINITION _cached_encoder_for_IrisScan */ let _cached_encoder_for_IrisScan = null; /* END_OF_SYMBOL_DEFINITION _cached_encoder_for_IrisScan */ /* START_OF_SYMBOL_DEFINITION _encode_IrisScan */ /** * @summary Encodes a(n) IrisScan 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 IrisScan, encoded as an ASN.1 Element. */ function _encode_IrisScan(value, elGetter) { if (!_cached_encoder_for_IrisScan) { _cached_encoder_for_IrisScan = function (value, elGetter) { return $._encodeSequence([] .concat([ /* REQUIRED */ IrisScan_eye_ta_1._encode_IrisScan_eye(value.eye, $.BER), ], value._unrecognizedExtensionsList ? value._unrecognizedExtensionsList : []) .filter((c) => !!c), $.BER); }; } return _cached_encoder_for_IrisScan(value, elGetter); } exports._encode_IrisScan = _encode_IrisScan; /* END_OF_SYMBOL_DEFINITION _encode_IrisScan */ /* eslint-enable */ //# sourceMappingURL=IrisScan.ta.js.map