public final class PublicKeyCredentialCreationOptions
extends java.lang.Object
navigator.credentials.create().| Modifier and Type | Class and Description |
|---|---|
static class |
PublicKeyCredentialCreationOptions.PublicKeyCredentialCreationOptionsBuilder |
| Modifier and Type | Method and Description |
|---|---|
static PublicKeyCredentialCreationOptions.PublicKeyCredentialCreationOptionsBuilder.MandatoryStages |
builder() |
boolean |
equals(java.lang.Object o) |
static PublicKeyCredentialCreationOptions |
fromJson(java.lang.String json)
Decode an
PublicKeyCredentialCreationOptions from JSON. |
@NonNull AttestationConveyancePreference |
getAttestation()
Intended for use by Relying Parties that wish to express their preference for attestation
conveyance.
|
java.util.Optional<AuthenticatorSelectionCriteria> |
getAuthenticatorSelection() |
@NonNull ByteArray |
getChallenge()
A challenge intended to be used for generating the newly created credential’s attestation
object.
|
java.util.Optional<java.util.Set<PublicKeyCredentialDescriptor>> |
getExcludeCredentials() |
@NonNull RegistrationExtensionInputs |
getExtensions()
Additional parameters requesting additional processing by the client and authenticator.
|
@NonNull java.util.List<PublicKeyCredentialParameters> |
getPubKeyCredParams()
Information about the desired properties of the credential to be created.
|
@NonNull RelyingPartyIdentity |
getRp()
Contains data about the Relying Party responsible for the request.
|
java.util.Optional<java.lang.Long> |
getTimeout() |
@NonNull UserIdentity |
getUser()
Contains data about the user account for which the Relying Party is requesting attestation.
|
int |
hashCode() |
PublicKeyCredentialCreationOptions.PublicKeyCredentialCreationOptionsBuilder |
toBuilder() |
java.lang.String |
toCredentialsCreateJson()
Serialize this
PublicKeyCredentialCreationOptions value to JSON suitable for sending to
the client. |
java.lang.String |
toJson()
Encode this
PublicKeyCredentialCreationOptions to JSON. |
java.lang.String |
toString() |
public java.lang.String toCredentialsCreateJson()
throws com.fasterxml.jackson.core.JsonProcessingException
PublicKeyCredentialCreationOptions value to JSON suitable for sending to
the client.
Any ByteArray values in this data structure will be Base64Url encoded. Those values MUST be decoded into BufferSource values (such as
Uint8Array) on the client side before calling navigator.credentials.create()
.
After decoding binary values, the resulting JavaScript object is suitable for passing as an
argument to navigator.credentials.create().
navigator.credentials.create(), after decoding binary options from Base64Url
strings.com.fasterxml.jackson.core.JsonProcessingException - if JSON serialization fails.public java.lang.String toJson()
throws com.fasterxml.jackson.core.JsonProcessingException
PublicKeyCredentialCreationOptions to JSON. The inverse of fromJson(String).
This method is suitable for encoding the PublicKeyCredentialCreationOptions for
temporary storage so that it can later be passed as an argument to RelyingParty.finishRegistration(FinishRegistrationOptions). The fromJson(String)
factory function is guaranteed to restore an identical PublicKeyCredentialCreationOptions instance.
Note that encoding might not be needed if you can simply keep the PublicKeyCredentialCreationOptions instance in server memory.
PublicKeyCredentialCreationOptions encoded to JSON.com.fasterxml.jackson.core.JsonProcessingExceptionpublic static PublicKeyCredentialCreationOptions fromJson(java.lang.String json) throws com.fasterxml.jackson.core.JsonProcessingException
PublicKeyCredentialCreationOptions from JSON. The inverse of toJson().
If the JSON was generated by the toJson() method, then fromJson(String) in
the same library version guarantees to restore an identical PublicKeyCredentialCreationOptions instance. This is not guaranteed between different library
versions.
PublicKeyCredentialCreationOptions decoded from the input JSON.com.fasterxml.jackson.core.JsonProcessingExceptionpublic java.util.Optional<java.lang.Long> getTimeout()
public java.util.Optional<java.util.Set<PublicKeyCredentialDescriptor>> getExcludeCredentials()
public java.util.Optional<AuthenticatorSelectionCriteria> getAuthenticatorSelection()
public static PublicKeyCredentialCreationOptions.PublicKeyCredentialCreationOptionsBuilder.MandatoryStages builder()
public PublicKeyCredentialCreationOptions.PublicKeyCredentialCreationOptionsBuilder toBuilder()
@NonNull public @NonNull RelyingPartyIdentity getRp()
Its value's id member specifies the RP ID the credential
should be scoped to. If omitted, its value will be set by the client. See RelyingPartyIdentity for further details.
@NonNull public @NonNull UserIdentity getUser()
@NonNull public @NonNull ByteArray getChallenge()
@NonNull public @NonNull java.util.List<PublicKeyCredentialParameters> getPubKeyCredParams()
The sequence is ordered from most preferred to least preferred. The client makes a best-effort to create the most preferred credential that it can.
@NonNull public @NonNull AttestationConveyancePreference getAttestation()
AttestationConveyancePreference.NONE.@NonNull public @NonNull RegistrationExtensionInputs getExtensions()
For example, the caller may request that only authenticators with certain capabilities be used to create the credential, or that particular information be returned in the attestation object. Some extensions are defined in §9 WebAuthn Extensions; consult the IANA "WebAuthn Extension Identifier" registry established by [WebAuthn-Registries] for an up-to-date list of registered WebAuthn Extensions.
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