UNPKG

pkcs-ts

Version:

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

68 lines 6.28 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports._encode_AuthenticationType = exports._decode_AuthenticationType = exports._encode_PinAttributes = exports._decode_PinAttributes = exports.PinAttributes = exports._encode_ExternalAuthObjectAttributes = exports._decode_ExternalAuthObjectAttributes = exports._encode_BiometricAttributes = exports._decode_BiometricAttributes = exports.BiometricAttributes = exports._encode_AuthKeyAttributes = exports._decode_AuthKeyAttributes = exports.AuthKeyAttributes = exports._get_encoder_for_AuthenticationObject = exports._get_decoder_for_AuthenticationObject = 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 AuthenticationObject_ta_1 = require("../PKCS-15/AuthenticationObject.ta"); const AuthKeyAttributes_ta_1 = require("../PKCS-15/AuthKeyAttributes.ta"); const BiometricAttributes_ta_1 = require("../PKCS-15/BiometricAttributes.ta"); const ExternalAuthObjectAttributes_ta_1 = require("../PKCS-15/ExternalAuthObjectAttributes.ta"); const PinAttributes_ta_1 = require("../PKCS-15/PinAttributes.ta"); var AuthenticationObject_ta_2 = require("../PKCS-15/AuthenticationObject.ta"); Object.defineProperty(exports, "_get_decoder_for_AuthenticationObject", { enumerable: true, get: function () { return AuthenticationObject_ta_2._get_decoder_for_AuthenticationObject; } }); Object.defineProperty(exports, "_get_encoder_for_AuthenticationObject", { enumerable: true, get: function () { return AuthenticationObject_ta_2._get_encoder_for_AuthenticationObject; } }); var AuthKeyAttributes_ta_2 = require("../PKCS-15/AuthKeyAttributes.ta"); Object.defineProperty(exports, "AuthKeyAttributes", { enumerable: true, get: function () { return AuthKeyAttributes_ta_2.AuthKeyAttributes; } }); Object.defineProperty(exports, "_decode_AuthKeyAttributes", { enumerable: true, get: function () { return AuthKeyAttributes_ta_2._decode_AuthKeyAttributes; } }); Object.defineProperty(exports, "_encode_AuthKeyAttributes", { enumerable: true, get: function () { return AuthKeyAttributes_ta_2._encode_AuthKeyAttributes; } }); var BiometricAttributes_ta_2 = require("../PKCS-15/BiometricAttributes.ta"); Object.defineProperty(exports, "BiometricAttributes", { enumerable: true, get: function () { return BiometricAttributes_ta_2.BiometricAttributes; } }); Object.defineProperty(exports, "_decode_BiometricAttributes", { enumerable: true, get: function () { return BiometricAttributes_ta_2._decode_BiometricAttributes; } }); Object.defineProperty(exports, "_encode_BiometricAttributes", { enumerable: true, get: function () { return BiometricAttributes_ta_2._encode_BiometricAttributes; } }); var ExternalAuthObjectAttributes_ta_2 = require("../PKCS-15/ExternalAuthObjectAttributes.ta"); Object.defineProperty(exports, "_decode_ExternalAuthObjectAttributes", { enumerable: true, get: function () { return ExternalAuthObjectAttributes_ta_2._decode_ExternalAuthObjectAttributes; } }); Object.defineProperty(exports, "_encode_ExternalAuthObjectAttributes", { enumerable: true, get: function () { return ExternalAuthObjectAttributes_ta_2._encode_ExternalAuthObjectAttributes; } }); var PinAttributes_ta_2 = require("../PKCS-15/PinAttributes.ta"); Object.defineProperty(exports, "PinAttributes", { enumerable: true, get: function () { return PinAttributes_ta_2.PinAttributes; } }); Object.defineProperty(exports, "_decode_PinAttributes", { enumerable: true, get: function () { return PinAttributes_ta_2._decode_PinAttributes; } }); Object.defineProperty(exports, "_encode_PinAttributes", { enumerable: true, get: function () { return PinAttributes_ta_2._encode_PinAttributes; } }); let _cached_decoder_for_AuthenticationType = null; function _decode_AuthenticationType(el) { if (!_cached_decoder_for_AuthenticationType) { _cached_decoder_for_AuthenticationType = $._decode_extensible_choice({ "UNIVERSAL 16": [ "pin", AuthenticationObject_ta_1._get_decoder_for_AuthenticationObject(PinAttributes_ta_1._decode_PinAttributes), ], "CONTEXT 0": [ "biometricTemplate", $._decode_implicit(() => AuthenticationObject_ta_1._get_decoder_for_AuthenticationObject(BiometricAttributes_ta_1._decode_BiometricAttributes)), ], "CONTEXT 1": [ "authKey", $._decode_implicit(() => AuthenticationObject_ta_1._get_decoder_for_AuthenticationObject(AuthKeyAttributes_ta_1._decode_AuthKeyAttributes)), ], "CONTEXT 2": [ "external", $._decode_implicit(() => AuthenticationObject_ta_1._get_decoder_for_AuthenticationObject(ExternalAuthObjectAttributes_ta_1._decode_ExternalAuthObjectAttributes)), ], }); } return _cached_decoder_for_AuthenticationType(el); } exports._decode_AuthenticationType = _decode_AuthenticationType; let _cached_encoder_for_AuthenticationType = null; function _encode_AuthenticationType(value, elGetter) { if (!_cached_encoder_for_AuthenticationType) { _cached_encoder_for_AuthenticationType = $._encode_choice({ pin: AuthenticationObject_ta_1._get_encoder_for_AuthenticationObject(PinAttributes_ta_1._encode_PinAttributes), biometricTemplate: $._encode_implicit(asn1_ts_1.ASN1TagClass.context, 0, () => AuthenticationObject_ta_1._get_encoder_for_AuthenticationObject(BiometricAttributes_ta_1._encode_BiometricAttributes), $.BER), authKey: $._encode_implicit(asn1_ts_1.ASN1TagClass.context, 1, () => AuthenticationObject_ta_1._get_encoder_for_AuthenticationObject(AuthKeyAttributes_ta_1._encode_AuthKeyAttributes), $.BER), external: $._encode_implicit(asn1_ts_1.ASN1TagClass.context, 2, () => AuthenticationObject_ta_1._get_encoder_for_AuthenticationObject(ExternalAuthObjectAttributes_ta_1._encode_ExternalAuthObjectAttributes), $.BER), }, $.BER); } return _cached_encoder_for_AuthenticationType(value, elGetter); } exports._encode_AuthenticationType = _encode_AuthenticationType; //# sourceMappingURL=AuthenticationType.ta.js.map