Class RegisteredCredential
- java.lang.Object
-
- com.yubico.webauthn.RegisteredCredential
-
public final class RegisteredCredential extends java.lang.Object
An abstraction of a credential registered to a particular user.Instances of this class are not expected to be long-lived, and the library only needs to read them, never write them. You may at your discretion store them directly in your database, or assemble them from other components.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
RegisteredCredential.RegisteredCredentialBuilder
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static RegisteredCredential.RegisteredCredentialBuilder.MandatoryStages
builder()
boolean
equals(java.lang.Object o)
@NonNull ByteArray
getCredentialId()
The credential ID of the credential.@NonNull ByteArray
getPublicKeyCose()
The credential public key encoded in COSE_Key format, as defined in Section 7 of RFC 8152.long
getSignatureCount()
The stored signature count of the credential.@NonNull ByteArray
getUserHandle()
The user handle of the user the credential is registered to.int
hashCode()
java.util.Optional<java.lang.Boolean>
isBackedUp()
Deprecated.EXPERIMENTAL: This feature is from a not yet mature standard; it could change as the standard matures.java.util.Optional<java.lang.Boolean>
isBackupEligible()
Deprecated.EXPERIMENTAL: This feature is from a not yet mature standard; it could change as the standard matures.RegisteredCredential.RegisteredCredentialBuilder
toBuilder()
java.lang.String
toString()
-
-
-
Method Detail
-
isBackupEligible
@Deprecated public java.util.Optional<java.lang.Boolean> isBackupEligible()
Deprecated.EXPERIMENTAL: This feature is from a not yet mature standard; it could change as the standard matures.The state of the BE flag when this credential was registered, if known.If absent, it is not known whether or not this credential is backup eligible.
If present and
true
, the credential is backup eligible: it can be backed up in some way, most commonly by syncing the private key to a cloud account.If present and
false
, the credential is not backup eligible: it cannot be backed up in any way.CredentialRepository
implementations SHOULD set this to the first known value returned byRegistrationResult.isBackupEligible()
orAssertionResult.isBackupEligible()
, if known. If unknown,CredentialRepository
implementations SHOULD set this tonull
or not set this value.
-
isBackedUp
@Deprecated public java.util.Optional<java.lang.Boolean> isBackedUp()
Deprecated.EXPERIMENTAL: This feature is from a not yet mature standard; it could change as the standard matures.The last known state of the BS flag for this credential, if known.If absent, the backup state of the credential is not known.
If present and
true
, the credential is believed to be currently backed up.If present and
false
, the credential is believed to not be currently backed up.CredentialRepository
implementations SHOULD set this to the most recent value returned byAssertionResult.isBackedUp()
orRegistrationResult.isBackedUp()
, if known. If unknown,CredentialRepository
implementations SHOULD set this tonull
or not set this value.
-
builder
public static RegisteredCredential.RegisteredCredentialBuilder.MandatoryStages builder()
-
toBuilder
public RegisteredCredential.RegisteredCredentialBuilder toBuilder()
-
getCredentialId
@NonNull public @NonNull ByteArray getCredentialId()
The credential ID of the credential.
-
getUserHandle
@NonNull public @NonNull ByteArray getUserHandle()
The user handle of the user the credential is registered to.- See Also:
- User Handle,
UserIdentity.getId()
-
getPublicKeyCose
@NonNull public @NonNull ByteArray getPublicKeyCose()
-
getSignatureCount
public long getSignatureCount()
The stored signature count of the credential.This is used to validate the
signature counter
in authentication assertions.
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-