Class CredentialRecord
java.lang.Object
net.shibboleth.idp.plugin.authn.webauthn.storage.CredentialRecord
A credential record used to hold a registered credential. Can be serialized in and out of storage.
Equality is determined by comparing the wrapped credential.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classBuilder.static interfaceOptional builder stage.static interfaceBuilder stage.static interfaceBuilder stage.static interfaceBuilder stage.static interfaceBuilder stage.static interfaceBuilder stage. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final byte[]The AAGUID of the authenticator that created this credential.private final com.yubico.webauthn.RegisteredCredentialThe credential to register.private final StringAn optional nickname of the credential.Is the credential a discoverable type (passkey).private final InstantThe time the credential was last used for authentication.private final InstantThe time the registration took place.private final SortedSet<com.yubico.webauthn.data.AuthenticatorTransport>The set oftransportsthe authenticator can use to communicate with the client.private final com.yubico.webauthn.data.UserIdentityThe users identity.private final StringThe username of the user to the IdP.private final booleanWas the user verified during registration. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateCredentialRecord(CredentialRecord.Builder builder) Builder constructor. -
Method Summary
Modifier and TypeMethodDescriptionbuilder()Builder stage.booleanbyte[]Get the AAGUID of the authenticator that created this credential.com.yubico.webauthn.RegisteredCredentialGet the registered credential.Get the credential ID as a base64 encoded string.Get the credential ID as a base64URL encoded string.Get the credential ID as a Hex encoded string.Get the time the credential was last used for authentication.Get the nickname of this credential.Get the time the registration took place.SortedSet<com.yubico.webauthn.data.AuthenticatorTransport>Get the set oftransportsthe authenticator can use to communicate with the client.com.yubico.webauthn.data.UserIdentityGet the identity of the user this credential has been registered for.Get the username of the user to the IdP.Get the WebAuthn user.name of the user identity registered.inthashCode()Is the created credential discoverable?booleanWas user verification performed during registration?Get a builder based on this record which can be updated until it is finalised and built.com.yubico.webauthn.data.PublicKeyCredentialDescriptorConvert the credential registration into aPublicKeyCredentialDescriptor.withCredential(com.yubico.webauthn.RegisteredCredential newRegisteredCred) Deprecated, for removal: This API element is subject to removal in a future version.
-
Field Details
-
userIdentity
@Nonnull private final com.yubico.webauthn.data.UserIdentity userIdentityThe users identity. -
username
The username of the user to the IdP. -
credentialNickname
An optional nickname of the credential. -
transports
@Nonnull @Unmodifiable @NonnullElements private final SortedSet<com.yubico.webauthn.data.AuthenticatorTransport> transportsThe set oftransportsthe authenticator can use to communicate with the client. -
registrationTime
The time the registration took place. -
discoverable
Is the credential a discoverable type (passkey). Empty if not known. -
credential
@Nonnull @Unmodifiable @NonnullElements private final com.yubico.webauthn.RegisteredCredential credentialThe credential to register. -
aaguid
@Nullable private final byte[] aaguidThe AAGUID of the authenticator that created this credential. -
userVerified
private final boolean userVerifiedWas the user verified during registration. -
lastUsedTime
The time the credential was last used for authentication.
-
-
Constructor Details
-
CredentialRecord
Builder constructor.- Parameters:
builder- the builder
-
-
Method Details
-
isUserVerified
public boolean isUserVerified()Was user verification performed during registration?- Returns:
- true if user registration was performed, false otherwise
-
isDiscoverable
Is the created credential discoverable?- Returns:
- true if the credential is discoverable, false if it isn't, empty if unknown.
-
getNickname
Get the nickname of this credential.- Returns:
- the nickname
-
getRegistrationTime
Get the time the registration took place.- Returns:
- the time of registration
-
getUsername
Get the username of the user to the IdP.- Returns:
- the user's username
-
getWebAuthnUserName
Get the WebAuthn user.name of the user identity registered.- Returns:
- the name of the user identity
-
getUserIdentity
@Nonnull public com.yubico.webauthn.data.UserIdentity getUserIdentity()Get the identity of the user this credential has been registered for.- Returns:
- the users identity
-
getCredential
@Nonnull public com.yubico.webauthn.RegisteredCredential getCredential()Get the registered credential.- Returns:
- the registered credential
-
getTransports
@Nonnull @Unmodifiable @NonnullElements public SortedSet<com.yubico.webauthn.data.AuthenticatorTransport> getTransports()Get the set oftransportsthe authenticator can use to communicate with the client.- Returns:
- the set of transports the authenticator can use to communicate with the client
-
getAaguid
@Nullable public byte[] getAaguid()Get the AAGUID of the authenticator that created this credential. This is optional, for example if attestation is not requested.- Returns:
- the aaguid
-
getLastUsedTime
Get the time the credential was last used for authentication.- Returns:
- the last used time of the credential.
- Since:
- 1.1.0
-
getCredentialIdBase64Url
Get the credential ID as a base64URL encoded string.- Returns:
- the credential ID base64URL encoded
-
getCredentialIdBase64
Get the credential ID as a base64 encoded string.- Returns:
- the credential ID base64URL encoded
-
getCredentialIdHex
Get the credential ID as a Hex encoded string.- Returns:
- the credential ID Hex encoded
-
toBuilder
Get a builder based on this record which can be updated until it is finalised and built.- Returns:
- the builder
-
toPublicKeyCredentialDescriptor
@Nullable public com.yubico.webauthn.data.PublicKeyCredentialDescriptor toPublicKeyCredentialDescriptor()Convert the credential registration into aPublicKeyCredentialDescriptor.- Returns:
- the created
PublicKeyCredentialDescriptor
-
hashCode
public int hashCode() -
equals
-
withCredential
@Deprecated(since="1.1.0", forRemoval=true) public CredentialRecord withCredential(@Nonnull com.yubico.webauthn.RegisteredCredential newRegisteredCred) Deprecated, for removal: This API element is subject to removal in a future version.usetoBuilder()Copy this instance into a new credential registration instance replacing he registered credential with that given.- Parameters:
newRegisteredCred- the new credential- Returns:
- a new
CredentialRecordinstance
-
builder
Builder stage.- Returns:
- the next stage
-
toBuilder()