Package net.shibboleth.idp.plugin.authn.webauthn.context

# Class WebAuthnRegistrationContext

java.lang.Object
org.opensaml.messaging.context.BaseContext
net.shibboleth.idp.plugin.authn.webauthn.context.BaseWebAuthnContext
net.shibboleth.idp.plugin.authn.webauthn.context.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.

## Nested Class Summary

## Nested classes/interfaces inherited from class org.opensaml.messaging.context.BaseContext

`BaseContext.ContextSetNoRemoveIteratorDecorator, BaseContext.DeprecatedContextClassNameLookAside`

## Field Summary

Fields
Modifier and Type
Field
Description
`private com.yubico.webauthn.data.AttestationConveyancePreference`
`attestationConveyancePreference`
The attestation conveyance preference.
`private com.yubico.webauthn.data.AuthenticatorAttachment`
`authenticatorAttachmentRequirement`
The authenticator attachment requirement (cross-platform or platform).
`private byte[]`
`credentialIdToModify`
The ID of the credential that is going to be modified.
`private byte[]`
`credentialIdToRemove`
The ID of a credential that is going to be removed.
`private String`
`credentialNickname`
A display friendly nickname for the credential that is to be registered.
`private String`
`displayName`
The user.displayName supplied to the authenticator during generation of a new credential.
`private String`
`name`
The WebAuthn user.name of the user.
`private boolean`
`nicknameRequired`
Is nickname collection enabled or disabled?.
`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.
`private com.yubico.webauthn.data.PublicKeyCredentialCreationOptions`
`publicKeyCredentialCreationOptions`
The public key credential creation options for creating a new credential.
`private RegistrationResult`
`registrationResult`
The credential public key which is the result of registration of a new key pair generated by an authenticator.
`private com.yubico.webauthn.data.ResidentKeyRequirement`
`residentKeyRequirement`
The requirement on registering a ResidentKey.

## Constructor Summary

Constructors
Constructor
Description
`WebAuthnRegistrationContext()`

## Method Summary

Modifier and Type
Method
Description
`com.yubico.webauthn.data.AttestationConveyancePreference`
`getAttestationConveyancePreference()`
Get the attestation conveyance preference.
`com.yubico.webauthn.data.AuthenticatorAttachment`
`getAuthenticatorAttachmentRequirement()`
Get the authenticator attachment requirement.
`byte[]`
`getCredentialIdToModify()`
Get the ID of the credential that is going to be modified.
`byte[]`
`getCredentialIdToRemove()`
Get the ID of the credential that is going to be removed.
`String`
`getCredentialNickname()`
Get the display friendly nickname for this credential.
`String`
`getDisplayName()`
Get the human-palatable name for the user account.
`String`
`getName()`
The WebAuthn user.name of the user to use during credential registration.
`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.
`com.yubico.webauthn.data.PublicKeyCredentialCreationOptions`
`getPublicKeyCredentialCreationOptions()`
Get the options used to create public key credentials.
`RegistrationResult`
`getRegistrationResult()`
Get the credential public key which is the result of registration of a new key pair generated by the authenticator.
`com.yubico.webauthn.data.ResidentKeyRequirement`
`getResidentKeyRequirement()`
Get the ResidentKey requirement.
`boolean`
`isNicknameRequired()`
Is nickname collection required or not.
`BaseWebAuthnContext`
`setAttestationConveyancePreference(com.yubico.webauthn.data.AttestationConveyancePreference preference)`
Set the attestation conveyance preference.
`WebAuthnRegistrationContext`
`setAuthenticatorAttachmentRequirement(com.yubico.webauthn.data.AuthenticatorAttachment requirement)`
Set the authenticator attachment requirement.
`WebAuthnRegistrationContext`
`setCredentialIdToModify(byte[] id)`
Set the ID of the credential that is going to be modified.
`WebAuthnRegistrationContext`
`setCredentialIdToRemove(byte[] id)`
Deprecated, for removal: This API element is subject to removal in a future version.
Use `setCredentialIdToModify(byte[])` instead
`WebAuthnRegistrationContext`
`setCredentialNickname(String nickname)`
Set the display friendly nickname for this credential.
`BaseWebAuthnContext`
`setDisplayName(String dispName)`
Set the human-palatable name for the user account.
`BaseWebAuthnContext`
`setName(String webAuthnName)`
Set the WebAuthn user.name of the user to use during credential registration.
`BaseWebAuthnContext`
`setNicknameRequired(boolean flag)`
Set if nickname collection is required or not.
`WebAuthnRegistrationContext`
`setPublicKeyCredentialAttestationResponse(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.
`WebAuthnRegistrationContext`
`setPublicKeyCredentialCreationOptions(com.yubico.webauthn.data.PublicKeyCredentialCreationOptions options)`
Set the options used to create public key credentials.
`WebAuthnRegistrationContext`
`setRegistrationResult(RegistrationResult result)`
Set the registration result which is the result of registration of a new key pair generated by an authenticator.
`WebAuthnRegistrationContext`
`setResidentKeyRequirement(com.yubico.webauthn.data.ResidentKeyRequirement requirement)`
Set the ResidentKey requirement.

### Methods inherited from class net.shibboleth.idp.plugin.authn.webauthn.context.BaseWebAuthnContext

`getExistingCredentials, getRawUsername, getServerChallenge, getUserId, getUsername, getUserVerificationRequirement, isWebAuthnAvailable, setExistingCredentials, setRawUsername, setServerChallenge, setUserId, setUsername, setUserVerificationRequirement`

### Methods inherited from class org.opensaml.messaging.context.BaseContext

`addSubcontext, addSubcontext, clearSubcontexts, containsSubcontext, createSubcontext, ensureSubcontext, ensureSubcontext, getParent, getSubcontext, getSubcontext, getSubcontext, getSubcontext, iterator, removeFromParent, removeSubcontext, removeSubcontext, setParent`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Methods inherited from interface java.lang.Iterable

`forEach, spliterator`

## 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.

### nicknameRequired

private boolean nicknameRequired
Is nickname collection enabled or disabled?.

### credentialIdToModify

@Nullable private byte[] credentialIdToModify
The ID of the credential that is going to be modified.

## Constructor Details

### WebAuthnRegistrationContext

public WebAuthnRegistrationContext()

## Method Details

### isNicknameRequired

public boolean isNicknameRequired()
Is nickname collection required or not. The nickname is used for display purposes only.

Returns:
  true if the nickname is required, false otherwise.
Since:
  1.1.0

### setNicknameRequired

public BaseWebAuthnContext setNicknameRequired(boolean flag)
Set if nickname collection is required or not. The nickname is used for display purposes only.

Parameters:
  `flag` - the flag to set
Returns:
  this context
Since:
  1.1.0

### 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

@Deprecated(since="1.2.0", forRemoval=true) @Nonnull public WebAuthnRegistrationContext setCredentialIdToRemove(@Nullable byte[] id)
Deprecated, for removal: This API element is subject to removal in a future version.
Use `setCredentialIdToModify(byte[])` instead
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 known 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 known 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.

### setCredentialIdToModify

@Nonnull public WebAuthnRegistrationContext setCredentialIdToModify(@Nullable byte[] id)
Set the ID of the credential that is going to be modified.

Parameters:
  `id` - the credential identifier
Returns:
  this context
Since:
  1.2.0

### getCredentialIdToModify

@Nullable public byte[] getCredentialIdToModify()
Get the ID of the credential that is going to be modified.

Returns:
  the identifier of the credential to be modified.
Since:
  1.2.0