Class RegisteredCredential
- All Implemented Interfaces:
CredentialRecord,ToPublicKeyCredentialDescriptor
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 -
Method Summary
Modifier and TypeMethodDescriptionbuilder()boolean@NonNull ByteArrayThe credential ID of the credential.@NonNull PublicKeyThe public key of the credential, parsed as aPublicKeyobject.@NonNull ByteArrayThe credential public key encoded in COSE_Key format, as defined in Section 7 of RFC 8152.longThe stored signature count of the credential.Deprecated.EXPERIMENTAL: This is an experimental feature.@NonNull ByteArrayThe user handle of the user the credential is registered to.inthashCode()Deprecated.EXPERIMENTAL: This feature is from a not yet mature standard; it could change as the standard matures.Deprecated.EXPERIMENTAL: This feature is from a not yet mature standard; it could change as the standard matures.toString()Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.yubico.webauthn.CredentialRecord
toPublicKeyCredentialDescriptor
-
Method Details
-
getParsedPublicKey
@NonNull public @NonNull PublicKey getParsedPublicKey() throws InvalidKeySpecException, NoSuchAlgorithmException, IOExceptionThe public key of the credential, parsed as aPublicKeyobject. -
getTransports
Deprecated.EXPERIMENTAL: This is an experimental feature. It is likely to change or be deleted before reaching a mature release.Transport hints as to how the client might communicate with the authenticator this credential is bound to.This SHOULD be set to the value returned by
AuthenticatorAttestationResponse.getTransports()when the credential was created. That value SHOULD NOT be modified.This is only used if the
RelyingPartyis configured with aCredentialRepositoryV2, in which case this is used to setPublicKeyCredentialDescriptor.getTransports()inexcludeCredentialsinRelyingParty.startRegistration(StartRegistrationOptions)andallowCredentialsinRelyingParty.startAssertion(StartAssertionOptions). This is not used if theRelyingPartyis configured with aCredentialRepository.- Specified by:
getTransportsin interfaceCredentialRecord- See Also:
-
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.CredentialRepositoryimplementations SHOULD set this to the first known value returned byRegistrationResult.isBackupEligible()orAssertionResult.isBackupEligible(), if known. If unknown,CredentialRepositoryimplementations SHOULD set this tonullor not set this value.- Specified by:
isBackupEligiblein interfaceCredentialRecord
-
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.CredentialRepositoryimplementations SHOULD set this to the most recent value returned byAssertionResult.isBackedUp()orRegistrationResult.isBackedUp(), if known. If unknown,CredentialRepositoryimplementations SHOULD set this tonullor not set this value.- Specified by:
isBackedUpin interfaceCredentialRecord
-
builder
-
toBuilder
-
getCredentialId
The credential ID of the credential.- Specified by:
getCredentialIdin interfaceCredentialRecord- See Also:
-
getUserHandle
The user handle of the user the credential is registered to.- Specified by:
getUserHandlein interfaceCredentialRecord- See Also:
-
getPublicKeyCose
The credential public key encoded in COSE_Key format, as defined in Section 7 of RFC 8152.This is used to verify the
signaturein authentication assertions.- Specified by:
getPublicKeyCosein interfaceCredentialRecord- See Also:
-
getSignatureCount
public long getSignatureCount()The stored signature count of the credential.This is used to validate the
signature counterin authentication assertions.- Specified by:
getSignatureCountin interfaceCredentialRecord- See Also:
-
equals
-
hashCode
public int hashCode() -
toString
-