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

# Class CredentialRecord.Builder

java.lang.Object
net.shibboleth.idp.plugin.authn.webauthn.storage.CredentialRecord.Builder

All Implemented Interfaces:
  `CredentialRecord.IBuildStage`, `CredentialRecord.ICredentialStage`, `CredentialRecord.IRegistrationTimeStage`, `CredentialRecord.ITransportsStage`, `CredentialRecord.IUserIdentityStage`, `CredentialRecord.IUsernameStage`

Enclosing class:
  CredentialRecord

public static final class CredentialRecord.Builder extends Object implements CredentialRecord.IUserIdentityStage, CredentialRecord.IUsernameStage, CredentialRecord.ITransportsStage, CredentialRecord.IRegistrationTimeStage, CredentialRecord.ICredentialStage, CredentialRecord.IBuildStage
Builder.

## Field Summary

Fields
Modifier and Type
Field
Description
`private byte[]`
`aaguid`
The AAGUID of the authenticator.
`private com.yubico.webauthn.RegisteredCredential`
`credential`
The registered credential.
`private String`
`credentialNickname`
The credential's nickname.
`private Optional<Boolean>`
`discoverable`
Is the credential a discoverable type.
`private Instant`
`lastUsedTime`
The time the credential was last used for authentication.
`private Instant`
`registrationTime`
The credential registration time .
`private SortedSet<com.yubico.webauthn.data.AuthenticatorTransport>`
`transports`
The transports.
`private com.yubico.webauthn.data.UserIdentity`
`userIdentity`
The users identity.
`private String`
`username`
The username of the user to the IdP.
`private boolean`
`userVerified`
has the user been verified.

## Constructor Summary

Constructors
Constructor
Description
`Builder()`
Constructor.
`Builder(CredentialRecord existingRecord)`
Constructor to build a new `CredentialRecord` from the given one.

## Method Summary

Modifier and Type
Method
Description
`CredentialRecord`
`build()`
Build this credential registration.
`CredentialRecord.IBuildStage`
`withAaguid(byte[] authenticatorGuid)`
Set the AAGUID of the authenticator that created this credential.
`CredentialRecord.IBuildStage`
`withCredential(com.yubico.webauthn.RegisteredCredential cred)`
Set the credential to register.
`CredentialRecord.IBuildStage`
`withCredentialNickname(String credNickname)`
Set an optional nickname of the credential.
`CredentialRecord.IBuildStage`
`withDiscoverable(Optional<Boolean> isDiscoverable)`
Is the credential a discoverable type (passkey).
`CredentialRecord.IBuildStage`
`withLastUsedTime(Instant time)`
Set the last authenticated time for this credential.
`CredentialRecord.ICredentialStage`
`withRegistrationTime(Instant time)`
Set the time the registration took place.
`CredentialRecord.IRegistrationTimeStage`
`withTransports(SortedSet<com.yubico.webauthn.data.AuthenticatorTransport> authenticatorTransports)`
Set the `transports` the authenticator can use to communicate with the client.
`CredentialRecord.IUsernameStage`
`withUserIdentity(com.yubico.webauthn.data.UserIdentity user)`
The users identity.
`CredentialRecord.ITransportsStage`
`withUsername(String name)`
The username of the user to the IdP.
`CredentialRecord.IBuildStage`
`withUserVerified(boolean isUserVerified)`
Was the user verified during registration?

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

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

## Field Details

### userIdentity

@Nonnull private com.yubico.webauthn.data.UserIdentity userIdentity
The users identity.

### username

@Nonnull private String username
The username of the user to the IdP.

### transports

@Nonnull private SortedSet<com.yubico.webauthn.data.AuthenticatorTransport> transports
The transports.

### registrationTime

@Nonnull private Instant registrationTime
The credential registration time .

### credential

@Nonnull private com.yubico.webauthn.RegisteredCredential credential
The registered credential.

### credentialNickname

@Nullable private String credentialNickname
The credential's nickname.

### discoverable

@Nonnull private Optional<Boolean> discoverable
Is the credential a discoverable type.

### userVerified

private boolean userVerified
has the user been verified.

### aaguid

@Nullable private byte[] aaguid
The AAGUID of the authenticator.

### lastUsedTime

@Nullable private Instant lastUsedTime
The time the credential was last used for authentication.

## Constructor Details

### Builder

public Builder()
Constructor.

### Builder

public Builder(CredentialRecord existingRecord)
Constructor to build a new `CredentialRecord` from the given one. This remains mutable until this object is built.

Parameters:
  `existingRecord` - the existing record to copy

## Method Details

### withUserIdentity

@Nonnull public CredentialRecord.IUsernameStage withUserIdentity(@Nonnull com.yubico.webauthn.data.UserIdentity user)
Description copied from interface: `CredentialRecord.IUserIdentityStage`
The users identity.

Specified by:
  `withUserIdentity` in interface `CredentialRecord.IUserIdentityStage`
Parameters:
  `user` - the users identity
Returns:
  the next builder stage

### withUsername

@Nonnull public CredentialRecord.ITransportsStage withUsername(@Nonnull String name)
Description copied from interface: `CredentialRecord.IUsernameStage`
The username of the user to the IdP.

Specified by:
  `withUsername` in interface `CredentialRecord.IUsernameStage`
Parameters:
  `name` - the username of the user
Returns:
  the next builder stage

### withTransports

@Nonnull public CredentialRecord.IRegistrationTimeStage withTransports(@Nonnull SortedSet<com.yubico.webauthn.data.AuthenticatorTransport> authenticatorTransports)
Description copied from interface: `CredentialRecord.ITransportsStage`
Set the `transports` the authenticator can use to communicate with the client.

Specified by:
  `withTransports` in interface `CredentialRecord.ITransportsStage`
Parameters:
  `authenticatorTransports` - the transports
Returns:
  the next builder stage

### withRegistrationTime

@Nonnull public CredentialRecord.ICredentialStage withRegistrationTime(@Nonnull Instant time)
Description copied from interface: `CredentialRecord.IRegistrationTimeStage`
Set the time the registration took place.

Specified by:
  `withRegistrationTime` in interface `CredentialRecord.IRegistrationTimeStage`
Parameters:
  `time` - the registration time
Returns:
  the next builder stage

### withCredential

@Nonnull public CredentialRecord.IBuildStage withCredential(@Nonnull com.yubico.webauthn.RegisteredCredential cred)
Description copied from interface: `CredentialRecord.ICredentialStage`
Set the credential to register.

Specified by:
  `withCredential` in interface `CredentialRecord.ICredentialStage`
Parameters:
  `cred` - the credential
Returns:
  the next builder stage

### withCredentialNickname

@Nonnull public CredentialRecord.IBuildStage withCredentialNickname(@Nullable String credNickname)
Description copied from interface: `CredentialRecord.IBuildStage`
Set an optional nickname of the credential.

Specified by:
  `withCredentialNickname` in interface `CredentialRecord.IBuildStage`
Parameters:
  `credNickname` - the nickname
Returns:
  the next builder stage

### withDiscoverable

@Nonnull public CredentialRecord.IBuildStage withDiscoverable(@Nonnull Optional<Boolean> isDiscoverable)
Description copied from interface: `CredentialRecord.IBuildStage`
Is the credential a discoverable type (passkey). Empty if not known.

Specified by:
  `withDiscoverable` in interface `CredentialRecord.IBuildStage`
Parameters:
  `isDiscoverable` - is the credential a discoverable type (passkey). Empty if not known
Returns:
  the next builder stage

### withUserVerified

@Nonnull public CredentialRecord.IBuildStage withUserVerified(boolean isUserVerified)
Description copied from interface: `CredentialRecord.IBuildStage`
Was the user verified during registration?

Specified by:
  `withUserVerified` in interface `CredentialRecord.IBuildStage`
Parameters:
  `isUserVerified` - was the user verified during registration
Returns:
  the next builder stage

### withLastUsedTime

@Nonnull public CredentialRecord.IBuildStage withLastUsedTime(Instant time)
Description copied from interface: `CredentialRecord.IBuildStage`
Set the last authenticated time for this credential.

Specified by:
  `withLastUsedTime` in interface `CredentialRecord.IBuildStage`
Parameters:
  `time` - the time the credential was last used to authenticate.
Returns:
  the next builder stage

### build

@Nonnull public CredentialRecord build()
Description copied from interface: `CredentialRecord.IBuildStage`
Build this credential registration.

Specified by:
  `build` in interface `CredentialRecord.IBuildStage`
Returns:
  a credential registration

### withAaguid

public CredentialRecord.IBuildStage withAaguid(byte[] authenticatorGuid)
Description copied from interface: `CredentialRecord.IBuildStage`
Set the AAGUID of the authenticator that created this credential.

Specified by:
  `withAaguid` in interface `CredentialRecord.IBuildStage`
Parameters:
  `authenticatorGuid` - the AAGUID of the authenticator
Returns:
  the next builder stage