Provides passkey capabilities.
System capability: SystemCapability.Security.FIDO2
Since: 6.0.0(20)
| Name | Description |
|---|---|
| fido2_api.h | Declares the APIs used to access FIDO2. APIs related to FIDO2 (passkey) capabilities are provided. The basic core capabilities of FIDO2 include obtaining supported FIDO2 capabilities, obtaining platform authenticator capabilities, registering passkeys, and using passkeys for authentication. |
| Name | Description |
|---|---|
| struct Uint8Buff | Defines a uint8_t byte stream. |
| struct AuthenticationExtensionsClientOutputs | Defines authentication extensions. |
| struct FIDO2_AuthenticatorResponse | Defines a struct of the authenticator assertion response. |
| struct FIDO2_PublicKeyAssertionCredential | Defines the struct for obtaining authentication results. |
| struct FIDO2_AuthenticatorTransportArray | Defines the array of authenticator transports. |
| struct FIDO2_AuthenticatorAttestationResponse | Defines the authenticator attestation response. |
| struct FIDO2_PublicKeyAttestationCredential | Defines the struct for obtaining registration results. |
| struct FIDO2_AuthenticatorSelectionCriteria | Defines the authenticator selection criteria, which are specified by a WebAuthn relying party (an app or a website). |
| struct FIDO2_PublicKeyCredentialDescriptor | Defines the credential parameters during registration or authentication. |
| struct FIDO2_PublicKeyCredentialParameters | Defines the additional parameters of an authentication credential. |
| struct FIDO2_PublicKeyCredentialUserEntity | Defines the user properties provided during credential creation. |
| struct FIDO2_PublicKeyCredentialRpEntity | Defines the relying party properties provided during credential creation. |
| struct FIDO2_PublicKeyCredentialDescriptorArray | Defines the array of public key credential descriptors. |
| struct FIDO2_PublicKeyCredentialHintArray | Defines the array of authentication mode hints. |
| struct FIDO2_PublicKeyCredentialRequestOptions | Defines the passkey authentication request parameters. |
| struct FIDO2_CredentialCreationOptionArray | Defines the array of additional parameters of an authentication credential. |
| struct FIDO2_AttestationFormatsArray | Defines preferences regarding the attestation statement format used by the authenticator. It is an array defined by the relying party. |
| struct FIDO2_PublicKeyCredentialCreationOptions | Defines the options for credential creation. |
| struct FIDO2_CredentialCreationOptions | Defines the credential request options. |
| struct FIDO2_AuthenticatorMetadata | Defines the authenticator metadata. |
| struct FIDO2_CredentialRequestOptions | Defines the authentication information dictionary object. |
| struct FIDO2_AuthenticatorMetadataArray | Defines the array of supported authenticators. |
| struct FIDO2_Capability | Defines passkey capabilities. |
| struct FIDO2_CapabilityArray | Defines the array of capabilities. |
| struct FIDO2_TokenBinding | Defines the token binding protocol, which is used by the client to communicate with the relying party. |
| Name | Description |
|---|---|
| typedef struct Uint8Buff Uint8Buff | Defines a uint8_t byte stream. |
| typedef enum FIDO2_TokenBindingStatus FIDO2_TokenBindingStatus | Defines an enum of token binding statuses. |
| typedef enum FIDO2_AttestationConveyancePreference FIDO2_AttestationConveyancePreference | Defines an enum of attestation conveyance preferences, which are referenced by a WebAuthn relying party during credential generation. |
| typedef enum FIDO2_UserVerificationRequirement FIDO2_UserVerificationRequirement | The relying party may need to perform user verification (to check whether the current user is the intended user) for some operations but not for others. The enumeration class is defined to distinguish different requirement levels. |
| typedef enum FIDO2_AuthenticatorAttachment FIDO2_AuthenticatorAttachment | Defines an enum of authenticator information (platform or roaming). |
| typedef enum FIDO2_AuthenticatorTransport FIDO2_AuthenticatorTransport | Defines an enum of authenticator transports. |
| typedef enum FIDO2_Algorithm FIDO2_Algorithm | Defines an enum of cryptographic algorithms. |
| typedef enum FIDO2_PublicKeyCredentialHint FIDO2_PublicKeyCredentialHint | Defines an enum of authentication mode hints. |
| typedef enum FIDO2_PublicKeyCredentialType FIDO2_PublicKeyCredentialType | Defines an enum of public key credential types. |
| typedef enum FIDO2_Uvm FIDO2_Uvm | Defines an enum of UVMs. |
| typedef enum FIDO2_ClientCapability FIDO2_ClientCapability | Defines an enum of client capabilities. |
| typedef enum FIDO2_CredentialMediationRequirement FIDO2_CredentialMediationRequirement | Enumerates the user mediation requirements. |
| typedef enum FIDO2_ErrorCode FIDO2_ErrorCode | Enumerates the error codes used in the HiCollie module. |
| typedef struct AuthenticationExtensionsClientOutputs AuthenticationExtensionsClientOutputs | Defines authentication extensions. |
| typedef struct FIDO2_AuthenticatorResponse FIDO2_AuthenticatorResponse | Defines a struct of the authenticator assertion response. |
| typedef struct FIDO2_PublicKeyAssertionCredential FIDO2_PublicKeyAssertionCredential | Defines the struct for obtaining authentication results. |
| typedef struct FIDO2_AuthenticatorTransportArray FIDO2_AuthenticatorTransportArray | Defines the array of authenticator transports. |
| typedef struct FIDO2_AuthenticatorAttestationResponse FIDO2_AuthenticatorAttestationResponse | Defines the authenticator attestation response. |
| typedef struct FIDO2_PublicKeyAttestationCredential FIDO2_PublicKeyAttestationCredential | Defines the struct for obtaining registration results. |
| typedef struct FIDO2_AuthenticatorSelectionCriteria FIDO2_AuthenticatorSelectionCriteria | Describes the authenticator selection criteria, which are specified by a WebAuthn relying party. |
| typedef struct FIDO2_PublicKeyCredentialDescriptor FIDO2_PublicKeyCredentialDescriptor | Defines the credential parameters during registration or authentication. |
| typedef struct FIDO2_PublicKeyCredentialParameters FIDO2_PublicKeyCredentialParameters | Defines the additional parameters of an authentication credential. |
| typedef struct FIDO2_PublicKeyCredentialUserEntity FIDO2_PublicKeyCredentialUserEntity | Defines the user properties provided during credential creation. |
| typedef struct FIDO2_PublicKeyCredentialRpEntity FIDO2_PublicKeyCredentialRpEntity | Defines the relying party properties provided during credential creation. |
| typedef struct FIDO2_PublicKeyCredentialDescriptorArray FIDO2_PublicKeyCredentialDescriptorArray | Defines the array of public key credential descriptors. |
| typedef struct FIDO2_PublicKeyCredentialHintArray FIDO2_PublicKeyCredentialHintArray | Defines the array of authentication mode hints. |
| typedef struct FIDO2_PublicKeyCredentialRequestOptions FIDO2_PublicKeyCredentialRequestOptions | Defines the passkey authentication request parameters. |
| typedef struct FIDO2_CredentialCreationOptionArray FIDO2_CredentialCreationOptionArray | Defines the array of additional parameters of an authentication credential. |
| typedef struct FIDO2_AttestationFormatsArray FIDO2_AttestationFormatsArray | Defines preferences regarding the attestation statement format used by the authenticator. It is an array defined by the relying party. |
| typedef struct FIDO2_PublicKeyCredentialCreationOptions FIDO2_PublicKeyCredentialCreationOptions | Defines the options for credential creation. |
| typedef struct FIDO2_CredentialCreationOptions FIDO2_CredentialCreationOptions | Defines the credential request options. |
| typedef struct FIDO2_AuthenticatorMetadata FIDO2_AuthenticatorMetadata | Defines the authenticator metadata. |
| typedef struct FIDO2_CredentialRequestOptions FIDO2_CredentialRequestOptions | Defines the authentication information dictionary object. |
| typedef struct FIDO2_AuthenticatorMetadataArray FIDO2_AuthenticatorMetadataArray | Defines the array of supported authenticators. |
| typedef struct FIDO2_Capability FIDO2_Capability | Defines passkey capabilities. |
| typedef struct FIDO2_CapabilityArray FIDO2_CapabilityArray | Defines the array of capabilities. |
| typedef struct FIDO2_TokenBinding FIDO2_TokenBinding | Defines a struct of the token binding protocol, which is used by the client to communicate with the relying party. |
| Name | Description |
|---|---|
| FIDO2_TokenBindingStatus { FIDO2_PRESENT = 0, FIDO2_SUPPORTED = 1 } | Defines an enum of token binding statuses. |
| FIDO2_AttestationConveyancePreference { FIDO2_NONE = 0, FIDO2_INDIRECT = 1, FIDO2_DIRECT = 2, FIDO2_ENTERPRISE = 3 } | Defines an enum of attestation conveyance preferences, which are referenced by a WebAuthn relying party during credential generation. |
| FIDO2_UserVerificationRequirement { FIDO2_REQUIRED = 0, FIDO2_PREFERRED = 1, FIDO2_DISCOURAGED = 2 } | The relying party may need to perform user verification (to check whether the current user is the intended user) for some operations but not for others. The enumeration class is defined to distinguish different requirement levels. |
| FIDO2_AuthenticatorAttachment { FIDO2_PLATFORM = 0, FIDO2_CROSS_PLATFORM = 1 } | Defines an enum of authenticator information (platform or roaming). |
FIDO2_AuthenticatorTransport { FIDO2_USB = 0, FIDO2_NFC = 1, FIDO2_BLE = 2, FIDO2_SMART_CARD = 3, FIDO2_HYBRID = 4, FIDO2_INTERNAL = 5 } | Defines an enum of authenticator transports. |
| FIDO2_ES256 = -7, FIDO2_ES384 = -35, FIDO2_ES512 = -36, FIDO2_RS256 = -257, FIDO2_RS384 = -258, FIDO2_RS512 = -259, FIDO2_PS256 = -37, FIDO2_PS384 = -38, FIDO2_PS512 = -39 } | Defines an enum of cryptographic algorithms. |
| FIDO2_PublicKeyCredentialHint { FIDO2_SECURITY_KEY = 0, FIDO2_CLIENT_DEVICE = 1, FIDO2_HINT_HYBRID = 2 } | Defines an enum of authentication mode hints. |
| FIDO2_PublicKeyCredentialType { FIDO2_PUBLIC_KEY = 0 } | Defines an enum of public key credential types. |
| FIDO2_Uvm { FIDO2_UVM_FINGERPRINT = 2, FIDO2_UVM_PIN = 4, FIDO2_UVM_FACEPRINT = 16 } | Defines an enum of UVMs. |
| FIDO2_CONDITIONAL_CREATE = 0, FIDO2_CONDITIONAL_GET = 1, FIDO2_HYBRID_TRANSPORT = 2, FIDO2_PASSKEY_PLATFORM_AUTHENTICATOR = 3, FIDO2_USER_VERIFYING_PLATFORM_AUTHENTICATOR = 4, FIDO2_RELATED_ORIGINS = 5, FIDO2_SIGNAL_ALL_ACCEPTED_CREDENTIALS = 6, FIDO2_SIGNAL_CURRENT_USER_DETAILS = 7, FIDO2_SIGNAL_UNKNOWN_CREDENTIAL = 8, FIDO2_EXTENSION_UVI = 9, FIDO2_EXTENSION_LARGEBLOB = 10, FIDO2_EXTENSION_AUTH_TYPE_LIST = 11 } | Defines an enum of client capabilities. |
| FIDO2_CredentialMediationRequirement { FIDO2_SILENT = 0, FIDO2_OPTIONAL = 1, FIDO2_CONDITIONAL = 2, FIDO2_MEDIATION_REQUIRED = 3 } | Enumerates the user mediation requirements. |
| FIDO2_SUCCESS = 0, FIDO2_PERMISSION_DENIED = 201, FIDO2_DEVICE_NOT_SUPPORT = 801, FIDO2_NOT_SUPPORT = 1021300001, FIDO2_INVALID_STATE = 1021300002, FIDO2_INTEGRITY_CHECK_FAILED = 1021300003, FIDO2_USER_ABORT = 1021300004, FIDO2_TIMEOUT = 1021300005, FIDO2_ENCODING_ERROR = 1021300006, FIDO2_UNKNOWN_ERROR = 1021300007, FIDO2_CONSTRAINT_ERROR = 1021300008, FIDO2_DATA_ERROR = 1021300009, FIDO2_USER_REJECTS = 1021300010, FIDO2_CONNECT_SERVICE_FAILED = 1021300011, FIDO2_MAX_CRED_NUM_REACHED = 1021300012, FIDO2_INVALID_CTAP_COMMAND = 1021310001, FIDO2_INVALID_PARAMETERS = 1021310002, FIDO2_INVALID_MESSAGE_OR_ATTRIBUTE_LENGTH = 1021310003, FIDO2_INVALID_CBOR_OR_UNPREDICTABLE = 1021310004, FIDO2_PARSE_CBOR_FAILED = 1021310005, FIDO2_INVALID_CREDENTIALS = 1021310006, FIDO2_NOT_ALLOWED = 1021310007, FIDO2_USER_VERIFICATION_FAILED = 1021310008, FIDO2_OTHER_ERROR = 1021310009, FIDO2_USER_CANCELLED_SWITCHED = 1021300013 } | Enumerates the error codes used in the HiCollie module. |
| Name | Description |
|---|---|
| void HMS_FIDO2_initCreationOptions (FIDO2_CredentialCreationOptions *options) | Initializes the FIDO2_CredentialCreationOptions struct. |
| void HMS_FIDO2_initTokenBinding (FIDO2_TokenBinding *tokenBinding) | Initializes the FIDO2_TokenBinding struct. |
| void HMS_FIDO2_initRequestOptions (FIDO2_CredentialRequestOptions *options) | Initializes the FIDO2_CredentialRequestOptions struct. |
| FIDO2_ErrorCode HMS_FIDO2_getClientCapability (FIDO2_CapabilityArray **capability) | Queries the client capabilities supported by the current device. When the value for a given capability is true, it indicates that the capability is supported. |
| FIDO2_ErrorCode HMS_FIDO2_getPlatformAuthenticator (FIDO2_AuthenticatorMetadataArray **authenticators) | Obtains the list of supported platform authenticators. |
| FIDO2_ErrorCode HMS_FIDO2_register (const FIDO2_CredentialCreationOptions options, const FIDO2_TokenBinding tokenBinding, const char *origin, FIDO2_PublicKeyAttestationCredential **publicKeyAttestationCredential) | Passkey registration. |
| FIDO2_ErrorCode HMS_FIDO2_authenticate (const FIDO2_CredentialRequestOptions options, const FIDO2_TokenBinding tokenBinding, const char *origin, FIDO2_PublicKeyAssertionCredential **publicKeyAssertionCredential) | Authentication using a passkey. |
| void HMS_FIDO2_CapabilityArray_Destroy (FIDO2_CapabilityArray *capability) | Destroys the array of capabilities. |
| void HMS_FIDO2_AuthenticatorMetadataArray_Destroy (FIDO2_AuthenticatorMetadataArray *authenticators) | Destroys the array of authenticator metadata. |
| void HMS_FIDO2_PublicKeyAttestationCredential_Destroy (FIDO2_PublicKeyAttestationCredential *publicKeyAttestationCredential) | Destroys the PublicKeyAttestationCredential struct. |
| void HMS_FIDO2_PublicKeyAssertionCredential_Destroy (FIDO2_PublicKeyAssertionCredential *publicKeyAssertionCredential) | Destroys the PublicKeyAssertionCredential struct. |
typedef struct AuthenticationExtensionsClientOutputs AuthenticationExtensionsClientOutputs
Description
Defines authentication extensions.
Since: 6.0.0(20)
typedef enum FIDO2_Algorithm FIDO2_Algorithm
Description
Enumerates cryptographic algorithms supported by FIDO2.
Since: 6.0.0(20)
typedef enum FIDO2_AttestationConveyancePreference FIDO2_AttestationConveyancePreference
Description
Defines an enum of attestation conveyance preferences, which are referenced by a WebAuthn relying party during credential generation.
Since: 6.0.0(20)
typedef struct FIDO2_AttestationFormatsArray FIDO2_AttestationFormatsArray
Description
Defines preferences regarding the attestation statement format used by the authenticator. It is an array defined by the relying party.
Since: 6.0.0(20)
typedef enum FIDO2_AuthenticatorAttachment FIDO2_AuthenticatorAttachment
Description
Defines an enum of authenticator information (platform or roaming).
Since: 6.0.0(20)
typedef struct FIDO2_AuthenticatorAttestationResponse FIDO2_AuthenticatorAttestationResponse
Description
Defines the authenticator attestation response.
Since: 6.0.0(20)
typedef struct FIDO2_AuthenticatorMetadata FIDO2_AuthenticatorMetadata
Description
Defines the authenticator metadata.
Since: 6.0.0(20)
typedef struct FIDO2_AuthenticatorMetadataArray FIDO2_AuthenticatorMetadataArray
Description
Defines the array of supported authenticators.
Since: 6.0.0(20)
typedef struct FIDO2_AuthenticatorResponse FIDO2_AuthenticatorResponse
Description
Defines a struct of the authenticator assertion response.
Since: 6.0.0(20)
typedef struct FIDO2_AuthenticatorSelectionCriteria FIDO2_AuthenticatorSelectionCriteria
Description
Describes the authenticator selection criteria, which are specified by a WebAuthn relying party.
Since: 6.0.0(20)
typedef enum FIDO2_AuthenticatorTransport FIDO2_AuthenticatorTransport
Description
Defines an enum of authenticator transports.
Since: 6.0.0(20)
typedef struct FIDO2_AuthenticatorTransportArray FIDO2_AuthenticatorTransportArray
Description
Defines the array of authenticator transports.
Since: 6.0.0(20)
typedef struct FIDO2_Capability FIDO2_Capability
Description
Defines passkey capabilities.
Since: 6.0.0(20)
typedef struct FIDO2_CapabilityArray FIDO2_CapabilityArray
Description
Defines the array of capabilities.
Since: 6.0.0(20)
typedef enum FIDO2_ClientCapability FIDO2_ClientCapability
Description
Defines an enum of client capabilities.
Since: 6.0.0(20)
typedef struct FIDO2_CredentialCreationOptionArray FIDO2_CredentialCreationOptionArray
Description
Defines the array of additional parameters of an authentication credential.
Since: 6.0.0(20)
typedef struct FIDO2_CredentialCreationOptions FIDO2_CredentialCreationOptions
Description
Defines the credential request options.
Since: 6.0.0(20)
typedef enum FIDO2_CredentialMediationRequirement FIDO2_CredentialMediationRequirement
Description
Enumerates the user mediation requirements.
Since: 6.0.0(20)
typedef struct FIDO2_CredentialRequestOptions FIDO2_CredentialRequestOptions
Description
Defines the authentication information dictionary object.
Since: 6.0.0(20)
typedef enum FIDO2_ErrorCode FIDO2_ErrorCode
Description
Defines error codes.
Since: 6.0.0(20)
typedef struct FIDO2_PublicKeyAssertionCredential FIDO2_PublicKeyAssertionCredential
Description
Defines the struct for obtaining authentication results.
Since: 6.0.0(20)
typedef struct FIDO2_PublicKeyAttestationCredential FIDO2_PublicKeyAttestationCredential
Description
Defines the struct for obtaining registration results.
Since: 6.0.0(20)
typedef struct FIDO2_PublicKeyCredentialCreationOptions FIDO2_PublicKeyCredentialCreationOptions
Description
Defines the options for credential creation.
Since: 6.0.0(20)
typedef struct FIDO2_PublicKeyCredentialDescriptor FIDO2_PublicKeyCredentialDescriptor
Description
Defines the credential parameters during registration or authentication.
Since: 6.0.0(20)
typedef struct FIDO2_PublicKeyCredentialDescriptorArray FIDO2_PublicKeyCredentialDescriptorArray
Description
Defines the array of public key credential descriptors.
Since: 6.0.0(20)
typedef enum FIDO2_PublicKeyCredentialHint FIDO2_PublicKeyCredentialHint
Description
Defines an enum of authentication mode hints.
Since: 6.0.0(20)
typedef struct FIDO2_PublicKeyCredentialHintArray FIDO2_PublicKeyCredentialHintArray
Description
Defines the array of authentication mode hints.
Since: 6.0.0(20)
typedef struct FIDO2_PublicKeyCredentialParameters FIDO2_PublicKeyCredentialParameters
Description
Additional parameters of an authentication credential.
Since: 6.0.0(20)
typedef struct FIDO2_PublicKeyCredentialRequestOptions FIDO2_PublicKeyCredentialRequestOptions
Description
Defines the passkey authentication request parameters.
Since: 6.0.0(20)
typedef struct FIDO2_PublicKeyCredentialRpEntity FIDO2_PublicKeyCredentialRpEntity
Description
Defines the relying party properties provided during credential creation.
Since: 6.0.0(20)
typedef enum FIDO2_PublicKeyCredentialType FIDO2_PublicKeyCredentialType
Description
Defines an enum of public key credential types.
Since: 6.0.0(20)
typedef struct FIDO2_PublicKeyCredentialUserEntity FIDO2_PublicKeyCredentialUserEntity
Description
Defines the user properties provided during credential creation.
Since: 6.0.0(20)
typedef struct FIDO2_TokenBinding FIDO2_TokenBinding
Description
Token binding protocol, which is used by the client to communicate with the relying party.
Since: 6.0.0(20)
typedef enum FIDO2_TokenBindingStatus FIDO2_TokenBindingStatus
Description
Defines an enum of token binding statuses.
Since: 6.0.0(20)
typedef enum FIDO2_UserVerificationRequirement FIDO2_UserVerificationRequirement
Description
The relying party may need to perform user verification (to check whether the current user is the intended user) for some operations but not for others. The enumeration class is defined to distinguish different requirement levels.
Since: 6.0.0(20)
typedef struct Uint8Buff Uint8Buff
Description
Defines a uint8_t byte stream.
Since: 6.0.0(20)
enum FIDO2_Algorithm
Description
Defines an enum of cryptographic algorithms.
Since: 6.0.0(20)
| Enumerated Value | Description |
|---|---|
| FIDO2_ES256 | ES256 algorithm. |
| FIDO2_ES384 | ES384 algorithm. |
| FIDO2_ES512 | ES512 algorithm. |
| FIDO2_RS256 | RS256 algorithm. |
| FIDO2_RS384 | RS384 algorithm. |
| FIDO2_RS512 | RS512 algorithm. |
| FIDO2_PS256 | PS256 algorithm. |
| FIDO2_PS384 | PS384 algorithm. |
| FIDO2_PS512 | PS512 algorithm. |
enum FIDO2_AttestationConveyancePreference
Description
Defines an enum of attestation conveyance preferences, which are referenced by a WebAuthn relying party during credential generation.
Since: 6.0.0(20)
| Enumerated Value | Description |
|---|---|
| FIDO2_NONE | The relying party is not interested in authenticator attestation. The default value is FIDO2_NONE. |
| FIDO2_INDIRECT | The indirect relying party wants to receive a verifiable attestation statement, but allows the client to decide how to obtain such an attestation statement. |
| FIDO2_DIRECT | The direct relying party wants to receive the attestation statement as generated by the authenticator. |
| FIDO2_ENTERPRISE | The relying party expects to receive enterprise attestation. An enterprise attestation is an attestation statement that may include information that uniquely identifies the authenticator. |
enum FIDO2_AuthenticatorAttachment
Description
Defines an enum of authenticator information (platform or roaming).
Since: 6.0.0(20)
| Enumerated Value | Description |
|---|---|
| FIDO2_PLATFORM | Platform authenticator, such as a PIN, fingerprint, or face. |
| FIDO2_CROSS_PLATFORM | Cross-platform authenticator, also called roaming authenticator, which includes Bluetooth, NFC, and USB. |
enum FIDO2_AuthenticatorTransport
Description
Enumerates the authenticator transports. It specifies the modes of transmitting authentication data between the authenticator and the client device.
Since: 6.0.0(20)
| Enumerated Value | Description |
|---|---|
| FIDO2_USB | USB. |
| FIDO2_NFC | Near Field Communication (NFC). |
| FIDO2_BLE | Bluetooth Low Energy (BLE). |
| FIDO2_SMART_CARD | Smart card. |
| FIDO2_HYBRID | Hybrid, indicating multiple data transport modes. |
| FIDO2_INTERNAL | Internal mode. |
enum FIDO2_ClientCapability
Description
Defines an enum of client capabilities.
Since: 6.0.0(20)
| Enumerated Value | Description |
|---|---|
| FIDO2_CONDITIONAL_CREATE | Passkey registration. |
| FIDO2_CONDITIONAL_GET | Authentication using a passkey. |
| FIDO2_HYBRID_TRANSPORT | Hybrid transport, indicating multiple data transport modes. |
| FIDO2_PASSKEY_PLATFORM_AUTHENTICATOR | Passkey platform authenticator. |
| FIDO2_USER_VERIFYING_PLATFORM_AUTHENTICATOR | User-verifying platform authenticator. |
| FIDO2_RELATED_ORIGINS | Supporting related origin requests. |
| FIDO2_SIGNAL_ALL_ACCEPTED_CREDENTIALS | Sending all accepted credentials. |
| FIDO2_SIGNAL_CURRENT_USER_DETAILS | Sending detailed information about the current user. |
| FIDO2_SIGNAL_UNKNOWN_CREDENTIAL | Sending unknown credentials. |
| FIDO2_EXTENSION_UVI | User Verification Index (UVI) extension parameter. |
| FIDO2_EXTENSION_LARGEBLOB | largeBlob extension parameter. Since: 26.0.0 |
| FIDO2_EXTENSION_AUTH_TYPE_LIST | authType extension parameter. Since: 26.0.0 |
enum FIDO2_CredentialMediationRequirement
Description
Enumerates the user mediation requirements.
Since: 6.0.0(20)
| Enumerated Value | Description |
|---|---|
| FIDO2_SILENT | User mediation is suppressed for a given operation. If the operation can be performed without user involvement, wonderful. If user involvement is necessary, then the operation will return null rather than involving the user. |
| FIDO2_OPTIONAL | User mediation is optional. If credentials can be handed over for a given operation without user mediation, they will be. If user mediation is required, then the user agent will involve the user in the decision. |
| FIDO2_CONDITIONAL | User mediation is required conditionally. In the authentication scenario, if the device has credentials, user mediation is required for selecting credentials. In the registration scenario, if the user has already agreed to create credentials, the credentials can be created without user mediation. |
| FIDO2_MEDIATION_REQUIRED | The user agent will not hand over credentials without user mediation. |
enum FIDO2_ErrorCode
Description
Defines error codes.
Since: 6.0.0(20)
| Enumerated Value | Description |
|---|---|
| FIDO2_SUCCESS | Successful. |
| FIDO2_PERMISSION_DENIED | Permission denied. |
| FIDO2_DEVICE_NOT_SUPPORT | Device type error. Since: 6.0.1(21) |
| FIDO2_NOT_SUPPORT | Not supported by the system. |
| FIDO2_INVALID_STATE | Invalid state. |
| FIDO2_INTEGRITY_CHECK_FAILED | System integrity check failed. |
| FIDO2_USER_ABORT | Terminated by the user. |
| FIDO2_TIMEOUT | Timeout. |
| FIDO2_ENCODING_ERROR | Encoding error. |
| FIDO2_UNKNOWN_ERROR | Unknown error. |
| FIDO2_CONSTRAINT_ERROR | Incorrect constraint condition. |
| FIDO2_DATA_ERROR | Data error. |
| FIDO2_USER_REJECTS | Rejected by the user. |
| FIDO2_CONNECT_SERVICE_FAILED | Service connection failed. |
| FIDO2_MAX_CRED_NUM_REACHED | The number of credentials reaches the maximum. |
| FIDO2_INVALID_CTAP_COMMAND | Invalid CTAP command. |
| FIDO2_INVALID_PARAMETERS | Invalid parameters in the command. |
| FIDO2_INVALID_MESSAGE_OR_ATTRIBUTE_LENGTH | Invalid message or property length. |
| FIDO2_INVALID_CBOR_OR_UNPREDICTABLE | Invalid CBOR or unpredictable error. |
| FIDO2_PARSE_CBOR_FAILED | CBOR parsing failed. |
| FIDO2_INVALID_CREDENTIALS | Invalid credentials. |
| FIDO2_NOT_ALLOWED | Disallow CANN Kit to select alternative hardware devices. |
| FIDO2_USER_VERIFICATION_FAILED | User authentication failed. |
| FIDO2_USER_CANCELLED_SWITCHED | The user fails to be authenticated and switches to another authentication mode. |
| FIDO2_OTHER_ERROR | Other errors. |
enum FIDO2_PublicKeyCredentialHint
Description
Enumerates the authentication mode hints. It specifies the authentication mode selected by the user.
Since: 6.0.0(20)
| Enumerated Value | Description |
|---|---|
| FIDO2_SECURITY_KEY | Security key. |
| FIDO2_CLIENT_DEVICE | Client device. |
| FIDO2_HINT_HYBRID | Hybrid. |
enum FIDO2_PublicKeyCredentialType
Description
Defines an enum of public key credential types.
Since: 6.0.0(20)
| Enumerated Value | Description |
|---|---|
| FIDO2_PUBLIC_KEY | Public key. |
enum FIDO2_TokenBindingStatus
Description
Defines an enum of token binding statuses.
Since: 6.0.0(20)
| Enumerated Value | Description |
|---|---|
| FIDO2_PRESENT | Normal communication. |
| FIDO2_SUPPORTED | Token binding is supported, but no negotiation is performed during communication with the relying party. |
enum FIDO2_UserVerificationRequirement
Description
The relying party may need to perform user verification (to check whether the current user is the intended user) for some operations but not for others. The enumeration class is defined to distinguish different requirement levels.
Since: 6.0.0(20)
| Enumerated Value | Description |
|---|---|
| FIDO2_REQUIRED | User verification is required. |
| FIDO2_PREFERRED | The relying party prefers user verification for the operation if possible, but will not fail the operation if the response does not have the user verification flag set. |
| FIDO2_DISCOURAGED | The relying party does not want user verification employed during the operation. |
enum FIDO2_Uvm
Description
Defines an enum of UVMs.
Since: 6.0.0(20)
| Enumerated Value | Description |
|---|---|
| FIDO2_UVM_FINGERPRINT | Fingerprint. |
| FIDO2_UVM_PIN | PIN. |
| FIDO2_UVM_FACEPRINT | 3D face. |
FIDO2_ErrorCode HMS_FIDO2_authenticate (const FIDO2_CredentialRequestOptions options, const FIDO2_TokenBinding tokenBinding, const char * origin, FIDO2_PublicKeyAssertionCredential ** publicKeyAssertionCredential)
Description
Authentication using a passkey. It can be called only by non-UI threads.
Required permission: ohos.permission.ACCESS_FIDO2_ONLINEAUTH
Since: 6.0.0(20)
Parameters
| Name | Description |
|---|---|
| options | Authentication request options. |
| tokenBinding | Token binding. |
| origin | Secure origin from which the method is called. The length ranges from 0 to 256 characters. |
| publicKeyAssertionCredential | Authentication response. |
Returns
If the function is executed successfully, FIDO2_SUCCESS is returned. If the function fails to be executed, a specific error code is returned. For details, please refer to FIDO2_ErrorCode.
void HMS_FIDO2_AuthenticatorMetadataArray_Destroy (FIDO2_AuthenticatorMetadataArray * authenticators)
Description
Destroys the array of authenticator metadata.
Since: 6.0.0(20)
Parameters
| Name | Description |
|---|---|
| authenticators | Array of the authenticator metadata to be destroyed. |
void HMS_FIDO2_CapabilityArray_Destroy (FIDO2_CapabilityArray * capability)
Description
Destroys the array of capabilities.
Since: 6.0.0(20)
Parameters
| Name | Description |
|---|---|
| capability | Array of capabilities to be destroyed. |
FIDO2_ErrorCode HMS_FIDO2_getClientCapability (FIDO2_CapabilityArray ** capability)
Description
Queries the client capabilities supported by the current device. When the value for a given capability is true, it indicates that the capability is supported.
Since: 6.0.0(20)
Parameters
| Name | Description |
|---|---|
| capability | Client capabilities of the device to be queried. |
Returns
If the function is executed successfully, FIDO2_SUCCESS is returned. If the function fails to be executed, an error code is returned. For details, please refer to FIDO2_ErrorCode.
FIDO2_ErrorCode HMS_FIDO2_getPlatformAuthenticator (FIDO2_AuthenticatorMetadataArray ** authenticators)
Description
Obtains the list of supported platform authenticators.
Since: 6.0.0(20)
Parameters
| Name | Description |
|---|---|
| authenticators | List of supported platform authenticators. |
Returns
If the function is executed successfully, FIDO2_SUCCESS is returned. If the function fails to be executed, an error code is returned. For details, please refer to FIDO2_ErrorCode.
void HMS_FIDO2_initCreationOptions (FIDO2_CredentialCreationOptions * options)
Description
Initializes the FIDO2_CredentialCreationOptions struct.
Since: 6.0.0(20)
Parameters
| Name | Description |
|---|---|
| options | Pointer to the FIDO2_CredentialCreationOptions struct to be initialized. |
void HMS_FIDO2_initRequestOptions (FIDO2_CredentialRequestOptions * options)
Description
Initializes the FIDO2_CredentialRequestOptions struct.
Since: 6.0.0(20)
Parameters
| Name | Description |
|---|---|
| options | Pointer to the FIDO2_CredentialRequestOptions struct to be initialized. |
void HMS_FIDO2_initTokenBinding (FIDO2_TokenBinding * tokenBinding)
Description
Initializes the FIDO2_TokenBinding struct.
Since: 6.0.0(20)
Parameters
| Name | Description |
|---|---|
| tokenBinding | Pointer to the FIDO2_TokenBinding struct to be initialized. |
void HMS_FIDO2_PublicKeyAssertionCredential_Destroy (FIDO2_PublicKeyAssertionCredential * publicKeyAssertionCredential)
Description
Destroys the FIDO2_PublicKeyAssertionCredential struct.
Since: 6.0.0(20)
Parameters
| Name | Description |
|---|---|
| publicKeyAssertionCredential | FIDO2_PublicKeyAssertionCredential struct to be destroyed. |
void HMS_FIDO2_PublicKeyAttestationCredential_Destroy (FIDO2_PublicKeyAttestationCredential * publicKeyAttestationCredential)
Description
Destroys the FIDO2_PublicKeyAttestationCredential struct.
Since: 6.0.0(20)
Parameters
| Name | Description |
|---|---|
| publicKeyAttestationCredential | FIDO2_PublicKeyAttestationCredential struct to be destroyed. |
FIDO2_ErrorCode HMS_FIDO2_register (const FIDO2_CredentialCreationOptions options, const FIDO2_TokenBinding tokenBinding, const char * origin, FIDO2_PublicKeyAttestationCredential ** publicKeyAttestationCredential)
Description
Passkey registration. It can be called only by non-UI threads.
Required permission: ohos.permission.ACCESS_FIDO2_ONLINEAUTH
Since: 6.0.0(20)
Parameters
| Name | Description |
|---|---|
| options | Registration request options. |
| tokenBinding | Token binding. |
| origin | Origin from which the method is called. The length ranges from 0 to 256 characters. |
| publicKeyAttestationCredential | Registration response. |
Returns
If the function is executed successfully, FIDO2_SUCCESS is returned. If the function fails to be executed, an error code is returned. For details, please refer to FIDO2_ErrorCode.