public interface CredentialRepository
This is used by RelyingParty
to look up credentials, usernames and user handles from usernames, user handles
and credential IDs.
Modifier and Type | Method and Description |
---|---|
java.util.Set<PublicKeyCredentialDescriptor> |
getCredentialIdsForUsername(java.lang.String username)
Get the credential IDs of all credentials registered to the user with the given username.
|
java.util.Optional<ByteArray> |
getUserHandleForUsername(java.lang.String username)
Get the user handle corresponding to the given username - the inverse of
getUsernameForUserHandle(ByteArray) . |
java.util.Optional<java.lang.String> |
getUsernameForUserHandle(ByteArray userHandle)
Get the username corresponding to the given user handle - the inverse of
getUserHandleForUsername(String) . |
java.util.Optional<RegisteredCredential> |
lookup(ByteArray credentialId,
ByteArray userHandle)
Look up the public key and stored signature count for the given credential registered to the given user.
|
java.util.Set<RegisteredCredential> |
lookupAll(ByteArray credentialId)
Look up all credentials with the given credential ID, regardless of what user they're registered to.
|
java.util.Set<PublicKeyCredentialDescriptor> getCredentialIdsForUsername(java.lang.String username)
java.util.Optional<ByteArray> getUserHandleForUsername(java.lang.String username)
getUsernameForUserHandle(ByteArray)
.java.util.Optional<java.lang.String> getUsernameForUserHandle(ByteArray userHandle)
getUserHandleForUsername(String)
.java.util.Optional<RegisteredCredential> lookup(ByteArray credentialId, ByteArray userHandle)
The returned RegisteredCredential
is not expected to be long-lived. It may be read directly from a
database or assembled from other components.
java.util.Set<RegisteredCredential> lookupAll(ByteArray credentialId)
This is used to refuse registration of duplicate credential IDs. Therefore, under normal circumstances this method should only return zero or one credential (this is an expected consequence, not an interface requirement).