UNPKG

pkcs-ts

Version:

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

134 lines 10.2 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports._encode_BiometricAttributes = exports._decode_BiometricAttributes = exports._extension_additions_list_spec_for_BiometricAttributes = exports._root_component_type_list_2_spec_for_BiometricAttributes = exports._root_component_type_list_1_spec_for_BiometricAttributes = exports.BiometricAttributes = exports._encode_Reference = exports._decode_Reference = exports._encode_Path = exports._decode_Path = exports.Path = exports._encode_BiometricType = exports._decode_BiometricType = exports._encode_BiometricFlags = exports._decode_BiometricFlags = exports.unblock_disabled = exports.local = exports.integrity_protected = exports.initialized = exports.disable_allowed = exports.confidentiality_protected = exports.change_disabled = exports.BiometricFlags_unblock_disabled = exports.BiometricFlags_local = exports.BiometricFlags_integrity_protected = exports.BiometricFlags_initialized = exports.BiometricFlags_disable_allowed = exports.BiometricFlags_confidentiality_protected = exports.BiometricFlags_change_disabled = 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 BiometricFlags_ta_1 = require("../PKCS-15/BiometricFlags.ta"); const BiometricType_ta_1 = require("../PKCS-15/BiometricType.ta"); const Path_ta_1 = require("../PKCS-15/Path.ta"); const Reference_ta_1 = require("../PKCS-15/Reference.ta"); var BiometricFlags_ta_2 = require("../PKCS-15/BiometricFlags.ta"); Object.defineProperty(exports, "BiometricFlags_change_disabled", { enumerable: true, get: function () { return BiometricFlags_ta_2.BiometricFlags_change_disabled; } }); Object.defineProperty(exports, "BiometricFlags_confidentiality_protected", { enumerable: true, get: function () { return BiometricFlags_ta_2.BiometricFlags_confidentiality_protected; } }); Object.defineProperty(exports, "BiometricFlags_disable_allowed", { enumerable: true, get: function () { return BiometricFlags_ta_2.BiometricFlags_disable_allowed; } }); Object.defineProperty(exports, "BiometricFlags_initialized", { enumerable: true, get: function () { return BiometricFlags_ta_2.BiometricFlags_initialized; } }); Object.defineProperty(exports, "BiometricFlags_integrity_protected", { enumerable: true, get: function () { return BiometricFlags_ta_2.BiometricFlags_integrity_protected; } }); Object.defineProperty(exports, "BiometricFlags_local", { enumerable: true, get: function () { return BiometricFlags_ta_2.BiometricFlags_local; } }); Object.defineProperty(exports, "BiometricFlags_unblock_disabled", { enumerable: true, get: function () { return BiometricFlags_ta_2.BiometricFlags_unblock_disabled; } }); Object.defineProperty(exports, "change_disabled", { enumerable: true, get: function () { return BiometricFlags_ta_2.change_disabled; } }); Object.defineProperty(exports, "confidentiality_protected", { enumerable: true, get: function () { return BiometricFlags_ta_2.confidentiality_protected; } }); Object.defineProperty(exports, "disable_allowed", { enumerable: true, get: function () { return BiometricFlags_ta_2.disable_allowed; } }); Object.defineProperty(exports, "initialized", { enumerable: true, get: function () { return BiometricFlags_ta_2.initialized; } }); Object.defineProperty(exports, "integrity_protected", { enumerable: true, get: function () { return BiometricFlags_ta_2.integrity_protected; } }); Object.defineProperty(exports, "local", { enumerable: true, get: function () { return BiometricFlags_ta_2.local; } }); Object.defineProperty(exports, "unblock_disabled", { enumerable: true, get: function () { return BiometricFlags_ta_2.unblock_disabled; } }); Object.defineProperty(exports, "_decode_BiometricFlags", { enumerable: true, get: function () { return BiometricFlags_ta_2._decode_BiometricFlags; } }); Object.defineProperty(exports, "_encode_BiometricFlags", { enumerable: true, get: function () { return BiometricFlags_ta_2._encode_BiometricFlags; } }); var BiometricType_ta_2 = require("../PKCS-15/BiometricType.ta"); Object.defineProperty(exports, "_decode_BiometricType", { enumerable: true, get: function () { return BiometricType_ta_2._decode_BiometricType; } }); Object.defineProperty(exports, "_encode_BiometricType", { enumerable: true, get: function () { return BiometricType_ta_2._encode_BiometricType; } }); var Path_ta_2 = require("../PKCS-15/Path.ta"); Object.defineProperty(exports, "Path", { enumerable: true, get: function () { return Path_ta_2.Path; } }); Object.defineProperty(exports, "_decode_Path", { enumerable: true, get: function () { return Path_ta_2._decode_Path; } }); Object.defineProperty(exports, "_encode_Path", { enumerable: true, get: function () { return Path_ta_2._encode_Path; } }); var Reference_ta_2 = require("../PKCS-15/Reference.ta"); Object.defineProperty(exports, "_decode_Reference", { enumerable: true, get: function () { return Reference_ta_2._decode_Reference; } }); Object.defineProperty(exports, "_encode_Reference", { enumerable: true, get: function () { return Reference_ta_2._encode_Reference; } }); class BiometricAttributes { constructor(bioFlags, templateId, bioType, bioReference, lastChange, path, _unrecognizedExtensionsList = []) { this.bioFlags = bioFlags; this.templateId = templateId; this.bioType = bioType; this.bioReference = bioReference; this.lastChange = lastChange; this.path = path; this._unrecognizedExtensionsList = _unrecognizedExtensionsList; } static _from_object(_o) { return new BiometricAttributes(_o.bioFlags, _o.templateId, _o.bioType, _o.bioReference, _o.lastChange, _o.path, _o._unrecognizedExtensionsList); } static get _default_value_for_bioReference() { return 0; } } exports.BiometricAttributes = BiometricAttributes; exports._root_component_type_list_1_spec_for_BiometricAttributes = [ new $.ComponentSpec("bioFlags", false, $.hasTag(asn1_ts_1.ASN1TagClass.universal, 3), undefined, undefined), new $.ComponentSpec("templateId", false, $.hasTag(asn1_ts_1.ASN1TagClass.universal, 6), undefined, undefined), new $.ComponentSpec("bioType", false, $.hasAnyTag, undefined, undefined), new $.ComponentSpec("bioReference", true, $.hasTag(asn1_ts_1.ASN1TagClass.universal, 2), undefined, undefined), new $.ComponentSpec("lastChange", true, $.hasTag(asn1_ts_1.ASN1TagClass.universal, 24), undefined, undefined), new $.ComponentSpec("path", true, $.hasTag(asn1_ts_1.ASN1TagClass.universal, 16), undefined, undefined), ]; exports._root_component_type_list_2_spec_for_BiometricAttributes = []; exports._extension_additions_list_spec_for_BiometricAttributes = []; let _cached_decoder_for_BiometricAttributes = null; function _decode_BiometricAttributes(el) { if (!_cached_decoder_for_BiometricAttributes) { _cached_decoder_for_BiometricAttributes = function (el) { let bioFlags; let templateId; let bioType; let bioReference = BiometricAttributes._default_value_for_bioReference; let lastChange; let path; let _unrecognizedExtensionsList = []; const callbacks = { bioFlags: (_el) => { bioFlags = BiometricFlags_ta_1._decode_BiometricFlags(_el); }, templateId: (_el) => { templateId = $._decodeObjectIdentifier(_el); }, bioType: (_el) => { bioType = BiometricType_ta_1._decode_BiometricType(_el); }, bioReference: (_el) => { bioReference = Reference_ta_1._decode_Reference(_el); }, lastChange: (_el) => { lastChange = $._decodeGeneralizedTime(_el); }, path: (_el) => { path = Path_ta_1._decode_Path(_el); }, }; $._parse_sequence(el, callbacks, exports._root_component_type_list_1_spec_for_BiometricAttributes, exports._extension_additions_list_spec_for_BiometricAttributes, exports._root_component_type_list_2_spec_for_BiometricAttributes, (ext) => { _unrecognizedExtensionsList.push(ext); }); return new BiometricAttributes(bioFlags, templateId, bioType, bioReference, lastChange, path, _unrecognizedExtensionsList); }; } return _cached_decoder_for_BiometricAttributes(el); } exports._decode_BiometricAttributes = _decode_BiometricAttributes; let _cached_encoder_for_BiometricAttributes = null; function _encode_BiometricAttributes(value, elGetter) { if (!_cached_encoder_for_BiometricAttributes) { _cached_encoder_for_BiometricAttributes = function (value, elGetter) { return $._encodeSequence([] .concat([ BiometricFlags_ta_1._encode_BiometricFlags(value.bioFlags, $.BER), $._encodeObjectIdentifier(value.templateId, $.BER), BiometricType_ta_1._encode_BiometricType(value.bioType, $.BER), value.bioReference === undefined || $.deepEq(value.bioReference, BiometricAttributes._default_value_for_bioReference) ? undefined : Reference_ta_1._encode_Reference(value.bioReference, $.BER), value.lastChange === undefined ? undefined : $._encodeGeneralizedTime(value.lastChange, $.BER), value.path === undefined ? undefined : Path_ta_1._encode_Path(value.path, $.BER), ], value._unrecognizedExtensionsList ? value._unrecognizedExtensionsList : []) .filter((c) => !!c), $.BER); }; } return _cached_encoder_for_BiometricAttributes(value, elGetter); } exports._encode_BiometricAttributes = _encode_BiometricAttributes; //# sourceMappingURL=BiometricAttributes.ta.js.map