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) |
java.util.Optional<AuthenticatorAttachment> |
getAuthenticatorAttachment()
Deprecated.
EXPERIMENTAL: This feature is from a not yet mature standard; it could change as
the standard matures.
|
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() |
@Deprecated public java.util.Optional<AuthenticatorAttachment> getAuthenticatorAttachment()
If parsed from JSON, this will be present if and only if the input was a valid value of
AuthenticatorAttachment.
The same value will also be available via RegistrationResult.getAuthenticatorAttachment() or AssertionResult.getAuthenticatorAttachment() on the result from RelyingParty.finishRegistration(FinishRegistrationOptions) or RelyingParty.finishAssertion(FinishAssertionOptions).
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.id
resp.attestationObject, Base64Url encoded as a string
resp.clientDataJSON, Base64Url encoded as a string
resp.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.id
resp.authenticatorData, Base64Url encoded as a string
resp.signature, Base64Url encoded as a string
resp.clientDataJSON, Base64Url encoded as a string
resp.userHandle Base64Url encoded as a string if present,
otherwise null or undefined
resp.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