public final class PublicKeyCredential<A extends AuthenticatorResponse,B extends ClientExtensionOutputs>
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static class |
PublicKeyCredential.PublicKeyCredentialBuilder<A extends AuthenticatorResponse,B extends ClientExtensionOutputs> |
| Modifier and Type | Method and Description |
|---|---|
static <A extends AuthenticatorResponse,B extends ClientExtensionOutputs> |
builder() |
boolean |
equals(java.lang.Object o) |
B |
getClientExtensionResults()
A map containing extension identifier → client extension output entries produced by the extension’s client
extension processing.
|
@NonNull ByteArray |
getId()
The raw Credential ID of this credential, corresponding to the
rawId attribute in the WebAuthn API. |
A |
getResponse()
The authenticator's response to the client’s request to either create a public key credential, or generate an
authentication assertion.
|
@NonNull PublicKeyCredentialType |
getType()
The
PublicKeyCredential's type value is the string "public-key". |
int |
hashCode() |
static PublicKeyCredential<AuthenticatorAssertionResponse,ClientAssertionExtensionOutputs> |
parseAssertionResponseJson(java.lang.String json)
Parse a
PublicKeyCredential object from JSON. |
static PublicKeyCredential<AuthenticatorAttestationResponse,ClientRegistrationExtensionOutputs> |
parseRegistrationResponseJson(java.lang.String json)
Parse a
PublicKeyCredential object from JSON. |
PublicKeyCredential.PublicKeyCredentialBuilder<A,B> |
toBuilder() |
java.lang.String |
toString() |
public static <A extends AuthenticatorResponse,B extends ClientExtensionOutputs> PublicKeyCredential.PublicKeyCredentialBuilder.MandatoryStages builder()
public static PublicKeyCredential<AuthenticatorAttestationResponse,ClientRegistrationExtensionOutputs> parseRegistrationResponseJson(java.lang.String json) throws java.io.IOException
PublicKeyCredential object from JSON.
The json should be of the following format:
{
"id": "(resp.id)",
"response": {
"attestationObject": "(Base64Url encoded resp.attestationObject)",
"clientDataJSON": "(Base64Url encoded resp.clientDataJSON)"
},
"clientExtensionResults": { (resp.getClientExtensionResults()) },
"type": "public-key"
}
resp.idresp.attestationObject, Base64Url encoded as a stringresp.clientDataJSON, Base64Url encoded as a stringresp.getClientExtensionResults()"public-key"json - a JSON string of the above formatjava.io.IOException - if the json is invalid or cannot be decoded as a PublicKeyCredentialpublic static PublicKeyCredential<AuthenticatorAssertionResponse,ClientAssertionExtensionOutputs> parseAssertionResponseJson(java.lang.String json) throws java.io.IOException
PublicKeyCredential object from JSON.
The json should be of the following format:
{
"id": "(resp.id)",
"response": {
"authenticatorData": "(Base64Url encoded resp.authenticatorData)",
"signature": "(Base64Url encoded resp.signature)",
"clientDataJSON": "(Base64Url encoded resp.clientDataJSON)",
"userHandle": "(null, undefined or Base64Url encoded resp.userHandle)"
},
"clientExtensionResults": { (resp.getClientExtensionResults()) },
"type": "public-key"
}
resp.idresp.authenticatorData, Base64Url encoded as a stringresp.signature, Base64Url encoded as a stringresp.clientDataJSON, Base64Url encoded as a stringresp.userHandle Base64Url encoded as a string if present, otherwise null or undefinedresp.getClientExtensionResults()"public-key"json - a JSON string of the above formatjava.io.IOException - if the json is invalid or cannot be decoded as a PublicKeyCredentialpublic PublicKeyCredential.PublicKeyCredentialBuilder<A,B> toBuilder()
@NonNull public @NonNull ByteArray getId()
rawId attribute in the WebAuthn API.@NonNull public A getResponse()
If the PublicKeyCredential was created in response to
navigator.credentials.create(), this attribute’s value will
be an AuthenticatorAttestationResponse, otherwise, the PublicKeyCredential was created in
response to
navigator.credentials.get(), and this attribute’s value will
be an AuthenticatorAssertionResponse.
@NonNull public B getClientExtensionResults()
@NonNull public @NonNull PublicKeyCredentialType getType()
PublicKeyCredential's type value is the string "public-key".public boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Object