UNPKG

@wildboar/qc

Version:
40 lines (39 loc) 1.67 kB
import * as $ from "@wildboar/asn1/functional"; import { _decode_PredefinedBiometricType, _encode_PredefinedBiometricType, } from "../PKIXqualified97/PredefinedBiometricType.ta.mjs"; let _cached_decoder_for_TypeOfBiometricData = null; /** * @summary Decodes an ASN.1 element into a(n) TypeOfBiometricData * @function * @param {_Element} el The element being decoded. * @returns {TypeOfBiometricData} The decoded data structure. */ export function _decode_TypeOfBiometricData(el) { if (!_cached_decoder_for_TypeOfBiometricData) { _cached_decoder_for_TypeOfBiometricData = $._decode_inextensible_choice({ "UNIVERSAL 2": [ "predefinedBiometricType", _decode_PredefinedBiometricType, ], "UNIVERSAL 6": ["biometricDataOid", $._decodeObjectIdentifier], }); } return _cached_decoder_for_TypeOfBiometricData(el); } let _cached_encoder_for_TypeOfBiometricData = null; /** * @summary Encodes a(n) TypeOfBiometricData into an ASN.1 Element. * @function * @param value The element being encoded. * @param elGetter A function that can be used to get new ASN.1 elements. * @returns {_Element} The TypeOfBiometricData, encoded as an ASN.1 Element. */ export function _encode_TypeOfBiometricData(value, elGetter) { if (!_cached_encoder_for_TypeOfBiometricData) { _cached_encoder_for_TypeOfBiometricData = $._encode_choice({ predefinedBiometricType: _encode_PredefinedBiometricType, biometricDataOid: $._encodeObjectIdentifier, }, $.BER); } return _cached_encoder_for_TypeOfBiometricData(value, elGetter); } /* eslint-enable */