com.mysql.cj.callback

## Class WebAuthnAuthenticationCallback

- java.lang.Object
- - com.mysql.cj.callback.WebAuthnAuthenticationCallback

All Implemented Interfaces:
  MysqlCallback

    public class WebAuthnAuthenticationCallback
    extends Object
    implements MysqlCallback

The callback object used by the authentication plugin AuthenticationWebAuthnClient to exchange authenticator data between the driver and the client application. Applications must implement a MysqlCallbackHandler to manage the interaction with authenticator devices and provide the data required to proceed with FIDO2/WebAuthn authentication. Such handler receives an instance of this class, which must then be used to obtain the data to send to the device and to submit the produced authenticator data and signature into the driver.

### Field Summary

Fields
`private List<byte[]>` `authenticatorDataEntries`
`private byte[]` `clientDataHash`
`private byte[]` `credentialId`
`private String` `relyingPartyId`
`private List<byte[]>` `signatureEntries`
`private boolean` `supportsCredentialManagement`

### Constructor Summary

Constructors
Constructor and Description
`WebAuthnAuthenticationCallback(byte[] clientDataHash, String relyingPartyId, byte[] credentialId)` Instances of this object are used to exchange FIDO data between the client application and the driver and are responsible for managing all the interactions with the FIDO authenticator devices.

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `addAuthenticatorData(byte[] authenticatorData)` Adds a FIDO Authenticator Data produced by the authenticator interaction.
`void` `addSignature(byte[] signature)` Adds a FIDO Signature produced by the authenticator interaction.
`int` `getAssertCount()` Returns the number of assertions produced by the authenticator interaction
`byte[]` `getAuthenticatorData(int idx)` Returns one of FIDO Authenticator Data produced by the authenticator interaction.
`byte[]` `getClientDataHash()` Returns the FIDO Client Data Hash (an SHA-256 hash computed from the Client Data JSON) for the upcoming authenticator interaction.
`byte[]` `getCredentialId()` Returns the FIDO Credential Id for the upcoming authenticator interaction.
`String` `getRelyingPartyId()` Returns the FIDO Relying Party Id for the upcoming authenticator interaction.
`byte[]` `getSignature(int idx)` Returns one of the FIDO Signatures produced by the authenticator interaction
`boolean` `getSupportsCredentialManagement()` Returns whether this FIDO Authenticator device supports Credential Management.
`void` `setSupportsCredentialManagement(boolean supportsCredMan)` Sets whether this FIDO Authenticator device supports Credential Management.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Field Detail

#### clientDataHash

    private byte[] clientDataHash

#### relyingPartyId

    private String relyingPartyId

#### credentialId

    private byte[] credentialId

#### supportsCredentialManagement

    private boolean supportsCredentialManagement

#### authenticatorDataEntries

    private List<byte[]> authenticatorDataEntries

#### signatureEntries

    private List<byte[]> signatureEntries

### Constructor Detail

#### WebAuthnAuthenticationCallback

    public WebAuthnAuthenticationCallback(byte[] clientDataHash,
                                          String relyingPartyId,
                                          byte[] credentialId)

Instances of this object are used to exchange FIDO data between the client application and the driver and are responsible for managing all the interactions with the FIDO authenticator devices.

Parameters:
  `clientDataHash` - the client data hash
  `relyingPartyId` - the relying party id
  `credentialId` - the credential id

### Method Detail

#### getClientDataHash

    public byte[] getClientDataHash()

Returns the FIDO Client Data Hash (an SHA-256 hash computed from the Client Data JSON) for the upcoming authenticator interaction.

Returns:
  the client data hash

#### getRelyingPartyId

    public String getRelyingPartyId()

Returns the FIDO Relying Party Id for the upcoming authenticator interaction.

Returns:
  the relying party id

#### getCredentialId

    public byte[] getCredentialId()

Returns the FIDO Credential Id for the upcoming authenticator interaction.

Returns:
  the credential id

#### setSupportsCredentialManagement

    public void setSupportsCredentialManagement(boolean supportsCredMan)

Sets whether this FIDO Authenticator device supports Credential Management.

Parameters:
  `supportsCredMan` - is credential management supported?

#### getSupportsCredentialManagement

    public boolean getSupportsCredentialManagement()

Returns whether this FIDO Authenticator device supports Credential Management.

Returns:
  is credential management supported?

#### addAuthenticatorData

    public void addAuthenticatorData(byte[] authenticatorData)

Adds a FIDO Authenticator Data produced by the authenticator interaction.

Parameters:
  `authenticatorData` - the authenticator data

#### getAuthenticatorData

    public byte[] getAuthenticatorData(int idx)

Returns one of FIDO Authenticator Data produced by the authenticator interaction.

Parameters:
  `idx` - the index of the Authenticator Data to return
Returns:
  the authenticator data

#### addSignature

    public void addSignature(byte[] signature)

Adds a FIDO Signature produced by the authenticator interaction.

Parameters:
  `signature` - the signature

#### getSignature

    public byte[] getSignature(int idx)

Returns one of the FIDO Signatures produced by the authenticator interaction

Parameters:
  `idx` - the index of the Signature to return
Returns:
  the signature

#### getAssertCount

    public int getAssertCount()

Returns the number of assertions produced by the authenticator interaction

Returns:
  the number of assertions

Copyright © 2016, 2024, Oracle and/or its affiliates.