Class WebAuthnRegistrationContext

All Implemented Interfaces:
Iterable<BaseContext>

@NotThreadSafe public final class WebAuthnRegistrationContext extends BaseWebAuthnContext
Registration context for processing WebAuthn Registration Ceremonies. This context is intended for registration of a single credential only. A context would be needed per credential registration.
  • Field Details

    • name

      @Nullable private String name
      The WebAuthn user.name of the user. A human-palatable identifier for a user account. It is intended only for display by the authenticator, and to help the user select between accounts.
    • publicKeyCredentialAttestationResponse

      @Nullable private com.yubico.webauthn.data.PublicKeyCredential<com.yubico.webauthn.data.AuthenticatorAttestationResponse,com.yubico.webauthn.data.ClientRegistrationExtensionOutputs> publicKeyCredentialAttestationResponse
      A public key credential containing the assertion response that is the result of creating a new credential.
    • publicKeyCredentialCreationOptions

      @Nullable private com.yubico.webauthn.data.PublicKeyCredentialCreationOptions publicKeyCredentialCreationOptions
      The public key credential creation options for creating a new credential.
    • registrationResult

      @Nullable private RegistrationResult registrationResult
      The credential public key which is the result of registration of a new key pair generated by an authenticator.
    • credentialNickname

      @Nullable private String credentialNickname
      A display friendly nickname for the credential that is to be registered.
    • credentialIdToRemove

      @Nullable private byte[] credentialIdToRemove
      The ID of a credential that is going to be removed.
    • residentKeyRequirement

      @Nullable private com.yubico.webauthn.data.ResidentKeyRequirement residentKeyRequirement
      The requirement on registering a ResidentKey. Also know as a discoverable credential.
    • authenticatorAttachmentRequirement

      @Nullable private com.yubico.webauthn.data.AuthenticatorAttachment authenticatorAttachmentRequirement
      The authenticator attachment requirement (cross-platform or platform). null would represent either possibility.
    • attestationConveyancePreference

      @Nullable private com.yubico.webauthn.data.AttestationConveyancePreference attestationConveyancePreference
      The attestation conveyance preference.
    • displayName

      @Nullable private String displayName
      The user.displayName supplied to the authenticator during generation of a new credential. A human-palatable name for the user account, intended only for display.
    • authenticatorCapabilities

      @Nullable private Map<String,String> authenticatorCapabilities
      A Map of authenticator capabilities. For example, should this authenticator only be used for second-factor authentication.
  • Constructor Details

    • WebAuthnRegistrationContext

      public WebAuthnRegistrationContext()
  • Method Details

    • setName

      @Nonnull public BaseWebAuthnContext setName(@Nullable String webAuthnName)
      Set the WebAuthn user.name of the user to use during credential registration. A human-palatable identifier for a user account. It is intended only for display.
      Parameters:
      webAuthnName - The WebAuthn user.name to set.
      Returns:
      this context
    • getName

      @Nullable public String getName()
      The WebAuthn user.name of the user to use during credential registration. A human-palatable identifier for a user account. It is intended only for display.
      Returns:
      the WebAuthn user.name.
    • setAuthenticatorAttachmentRequirement

      public WebAuthnRegistrationContext setAuthenticatorAttachmentRequirement(@Nullable com.yubico.webauthn.data.AuthenticatorAttachment requirement)
      Set the authenticator attachment requirement. null would represent either possibility.
      Parameters:
      requirement - The authenticatorAttachmentRequirement to set.
      Returns:
      this context
    • getAuthenticatorAttachmentRequirement

      public com.yubico.webauthn.data.AuthenticatorAttachment getAuthenticatorAttachmentRequirement()
      Get the authenticator attachment requirement. null would represent either possibility.
      Returns:
      the authenticator attachment requirement.
    • getPublicKeyCredentialAttestationResponse

      @Nullable public com.yubico.webauthn.data.PublicKeyCredential<com.yubico.webauthn.data.AuthenticatorAttestationResponse,com.yubico.webauthn.data.ClientRegistrationExtensionOutputs> getPublicKeyCredentialAttestationResponse()
      Get the public key credential containing the attestation response as a result of creating a new credential.
      Returns:
      the authenticator attestation response.
    • setPublicKeyCredentialAttestationResponse

      @Nonnull public WebAuthnRegistrationContext setPublicKeyCredentialAttestationResponse(@Nullable com.yubico.webauthn.data.PublicKeyCredential<com.yubico.webauthn.data.AuthenticatorAttestationResponse,com.yubico.webauthn.data.ClientRegistrationExtensionOutputs> pkCredAttestation)
      Set the public key credential containing the attestation response as a result of creating a new credential.
      Parameters:
      pkCredAttestation - The public key credential containing the attestation response to set.
      Returns:
      this context
    • setPublicKeyCredentialCreationOptions

      @Nonnull public WebAuthnRegistrationContext setPublicKeyCredentialCreationOptions(@Nullable com.yubico.webauthn.data.PublicKeyCredentialCreationOptions options)
      Set the options used to create public key credentials.
      Parameters:
      options - The public key credential creation options to set.
      Returns:
      this context
    • getPublicKeyCredentialCreationOptions

      @Nullable public com.yubico.webauthn.data.PublicKeyCredentialCreationOptions getPublicKeyCredentialCreationOptions()
      Get the options used to create public key credentials.
      Returns:
      the publicKeyCredentialCreationOptions
    • setRegistrationResult

      @Nonnull public WebAuthnRegistrationContext setRegistrationResult(@Nullable RegistrationResult result)
      Set the registration result which is the result of registration of a new key pair generated by an authenticator.
      Parameters:
      result - the registration result to set.
      Returns:
      this context
    • getRegistrationResult

      @Nullable public RegistrationResult getRegistrationResult()
      Get the credential public key which is the result of registration of a new key pair generated by the authenticator.
      Returns:
      Returns the registrationResult.
    • setCredentialNickname

      @Nonnull public WebAuthnRegistrationContext setCredentialNickname(@Nullable String nickname)
      Set the display friendly nickname for this credential.
      Parameters:
      nickname - The credential nickname to set.
      Returns:
      this context
    • getCredentialNickname

      @Nullable public String getCredentialNickname()
      Get the display friendly nickname for this credential.
      Returns:
      the credential nickname.
    • setCredentialIdToRemove

      @Nonnull public WebAuthnRegistrationContext setCredentialIdToRemove(@Nullable byte[] id)
      Set the ID of the credential that is going to be removed.
      Parameters:
      id - the credential identifier
      Returns:
      this context
    • getCredentialIdToRemove

      @Nullable public byte[] getCredentialIdToRemove()
      Get the ID of the credential that is going to be removed.
      Returns:
      Returns the credentialIdToRemove.
    • setResidentKeyRequirement

      @Nonnull public WebAuthnRegistrationContext setResidentKeyRequirement(@Nullable com.yubico.webauthn.data.ResidentKeyRequirement requirement)
      Set the ResidentKey requirement. A residenty key is also know as a discoverable credential.
      Parameters:
      requirement - The resident key requirement to set.
      Returns:
      this context
    • getResidentKeyRequirement

      @Nullable public com.yubico.webauthn.data.ResidentKeyRequirement getResidentKeyRequirement()
      Get the ResidentKey requirement. A residenty key is also know as a discoverable credential.
      Returns:
      the requirement.
    • setAttestationConveyancePreference

      @Nonnull public BaseWebAuthnContext setAttestationConveyancePreference(@Nullable com.yubico.webauthn.data.AttestationConveyancePreference preference)
      Set the attestation conveyance preference.
      Parameters:
      preference - the attestation conveyance preference
      Returns:
      this context
    • getAttestationConveyancePreference

      @Nullable public com.yubico.webauthn.data.AttestationConveyancePreference getAttestationConveyancePreference()
      Get the attestation conveyance preference.
      Returns:
      the attestationConveyancePreference.
    • setDisplayName

      @Nonnull public BaseWebAuthnContext setDisplayName(@Nullable String dispName)
      Set the human-palatable name for the user account.
      Parameters:
      dispName - The display name to set.
      Returns:
      this context
    • getDisplayName

      @Nullable public String getDisplayName()
      Get the human-palatable name for the user account.
      Returns:
      the displayName.
    • setAuthenticatorCapabilities

      @Nonnull public BaseWebAuthnContext setAuthenticatorCapabilities(@Nullable Map<String,String> capabilities)
      Set the capabilities map of the authenticator.
      Parameters:
      capabilities - the map of capabilities to set
      Returns:
      this context
    • getAuthenticatorCapabilities

      @Nonnull @NotLive @Unmodifiable public Map<String,String> getAuthenticatorCapabilities()
      Get the capabilities map of the authenticator.
      Returns:
      Returns the authenticatorCapabilities.