Top Description Fields Constructors Methods
com.mysql.cj.callback

public Class WebAuthnAuthenticationCallback

extends Object
implements MysqlCallback
Class Inheritance
All Implemented Interfaces
com.mysql.cj.callback.MysqlCallback
Imports
java.util.ArrayList, .List

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

Modifier and TypeField and Description
private List<byte[]>
private byte[]
private byte[]
private String
private List<byte[]>
private boolean

Constructor Summary

AccessConstructor and Description
public
WebAuthnAuthenticationCallback(byte[]
the client data hash
clientDataHash
,
String
the relying party id
relyingPartyId
,
byte[]
the credential id
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

Modifier and TypeMethod and Description
public void
addAuthenticatorData(byte[]
the authenticator data
authenticatorData
)

Adds a FIDO Authenticator Data produced by the authenticator interaction.

public void
addSignature(byte[]
the signature
signature
)

Adds a FIDO Signature produced by the authenticator interaction.

public int

Returns:

the number of assertions
getAssertCount
()

Returns the number of assertions produced by the authenticator interaction

public byte[]

Returns:

the authenticator data
getAuthenticatorData
(int
the index of the Authenticator Data to return
idx
)

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

public byte[]

Returns:

the client data hash
getClientDataHash
()

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

public byte[]

Returns:

the credential id
getCredentialId
()

Returns the FIDO Credential Id for the upcoming authenticator interaction.

public String

Returns:

the relying party id
getRelyingPartyId
()

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

public byte[]

Returns:

the signature
getSignature
(int
the index of the Signature to return
idx
)

Returns one of the FIDO Signatures produced by the authenticator interaction

public boolean

Returns:

is credential management supported?
getSupportsCredentialManagement
()

Returns whether this FIDO Authenticator device supports Credential Management.

public void
setSupportsCredentialManagement(boolean
is credential management supported?
supportsCredMan
)

Sets whether this FIDO Authenticator device supports Credential Management.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

authenticatorDataEntriesback to summary
private List<byte[]> authenticatorDataEntries
clientDataHashback to summary
private byte[] clientDataHash
credentialIdback to summary
private byte[] credentialId
relyingPartyIdback to summary
private String relyingPartyId
signatureEntriesback to summary
private List<byte[]> signatureEntries
supportsCredentialManagementback to summary
private boolean supportsCredentialManagement

Constructor Detail

WebAuthnAuthenticationCallbackback to summary
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:byte[]

the client data hash

relyingPartyId:String

the relying party id

credentialId:byte[]

the credential id

Method Detail

addAuthenticatorDataback to summary
public void addAuthenticatorData(byte[] authenticatorData)

Adds a FIDO Authenticator Data produced by the authenticator interaction.

Parameters
authenticatorData:byte[]

the authenticator data

addSignatureback to summary
public void addSignature(byte[] signature)

Adds a FIDO Signature produced by the authenticator interaction.

Parameters
signature:byte[]

the signature

getAssertCountback to summary
public int getAssertCount()

Returns the number of assertions produced by the authenticator interaction

Returns:int

the number of assertions

getAuthenticatorDataback to summary
public byte[] getAuthenticatorData(int idx)

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

Parameters
idx:int

the index of the Authenticator Data to return

Returns:byte[]

the authenticator data

getClientDataHashback to summary
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:byte[]

the client data hash

getCredentialIdback to summary
public byte[] getCredentialId()

Returns the FIDO Credential Id for the upcoming authenticator interaction.

Returns:byte[]

the credential id

getRelyingPartyIdback to summary
public String getRelyingPartyId()

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

Returns:String

the relying party id

getSignatureback to summary
public byte[] getSignature(int idx)

Returns one of the FIDO Signatures produced by the authenticator interaction

Parameters
idx:int

the index of the Signature to return

Returns:byte[]

the signature

getSupportsCredentialManagementback to summary
public boolean getSupportsCredentialManagement()

Returns whether this FIDO Authenticator device supports Credential Management.

Returns:boolean

is credential management supported?

setSupportsCredentialManagementback to summary
public void setSupportsCredentialManagement(boolean supportsCredMan)

Sets whether this FIDO Authenticator device supports Credential Management.

Parameters
supportsCredMan:boolean

is credential management supported?