UNPKG

@wildboar/pkcs

Version:
53 lines (52 loc) 2.58 kB
import { ASN1Element as _Element } from "asn1-ts"; import * as $ from "asn1-ts/dist/node/functional"; import { AuthenticationObject } from "../PKCS-15/AuthenticationObject.ta"; import { AuthKeyAttributes } from "../PKCS-15/AuthKeyAttributes.ta"; import { BiometricAttributes } from "../PKCS-15/BiometricAttributes.ta"; import { ExternalAuthObjectAttributes } from "../PKCS-15/ExternalAuthObjectAttributes.ta"; import { PinAttributes } from "../PKCS-15/PinAttributes.ta"; export { AuthenticationObject, _get_decoder_for_AuthenticationObject, _get_encoder_for_AuthenticationObject, } from "../PKCS-15/AuthenticationObject.ta"; export { AuthKeyAttributes, _decode_AuthKeyAttributes, _encode_AuthKeyAttributes, } from "../PKCS-15/AuthKeyAttributes.ta"; export { BiometricAttributes, _decode_BiometricAttributes, _encode_BiometricAttributes, } from "../PKCS-15/BiometricAttributes.ta"; export { ExternalAuthObjectAttributes, _decode_ExternalAuthObjectAttributes, _encode_ExternalAuthObjectAttributes, } from "../PKCS-15/ExternalAuthObjectAttributes.ta"; export { PinAttributes, _decode_PinAttributes, _encode_PinAttributes, } from "../PKCS-15/PinAttributes.ta"; /** * @summary AuthenticationType * @description * * ### ASN.1 Definition: * * ```asn1 * AuthenticationType ::= CHOICE { * pin AuthenticationObject { PinAttributes }, * ..., * biometricTemplate [0] AuthenticationObject {BiometricAttributes}, * authKey [1] AuthenticationObject {AuthKeyAttributes}, * external [2] AuthenticationObject {ExternalAuthObjectAttributes} * } * ``` */ export declare type AuthenticationType = { pin: AuthenticationObject<PinAttributes>; } | { biometricTemplate: AuthenticationObject<BiometricAttributes>; } | { authKey: AuthenticationObject<AuthKeyAttributes>; } | { external: AuthenticationObject<ExternalAuthObjectAttributes>; } | _Element; /** * @summary Decodes an ASN.1 element into a(n) AuthenticationType * @function * @param {_Element} el The element being decoded. * @returns {AuthenticationType} The decoded data structure. */ export declare function _decode_AuthenticationType(el: _Element): AuthenticationType; /** * @summary Encodes a(n) AuthenticationType 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 AuthenticationType, encoded as an ASN.1 Element. */ export declare function _encode_AuthenticationType(value: AuthenticationType, elGetter: $.ASN1Encoder<AuthenticationType>): _Element;