Package com.yubico.yubikit.fido.client
Class CredentialManager
java.lang.Object
com.yubico.yubikit.fido.client.CredentialManager
Provides management of resident key type credentials, which are stored on a YubiKey.
An instance of this class can be obtained by calling
BasicWebAuthnClient.getCredentialManager(char[]).-
Method Summary
Modifier and TypeMethodDescriptionvoiddeleteCredential(PublicKeyCredentialDescriptor credential) Delete a stored credential from the YubiKey.intGet the number of credentials currently stored on the YubiKey.getCredentials(String rpId) Get resident key credentials stored for a particular RP.Get a List of RP IDs for which this YubiKey has stored credentials.
-
Method Details
-
getCredentialCount
public int getCredentialCount() throws IOException, com.yubico.yubikit.core.application.CommandException, ClientErrorGet the number of credentials currently stored on the YubiKey.- Returns:
- The total number of resident credentials existing on the authenticator.
- Throws:
IOException- A communication error in the transport layer.com.yubico.yubikit.core.application.CommandException- A communication in the protocol layer.ClientError- A higher level error.
-
getRpIdList
public List<String> getRpIdList() throws IOException, com.yubico.yubikit.core.application.CommandException, ClientErrorGet a List of RP IDs for which this YubiKey has stored credentials.- Returns:
- A list of RP IDs, which can be used to call
getCredentials(String). - Throws:
IOException- A communication error in the transport layer.com.yubico.yubikit.core.application.CommandException- A communication in the protocol layer.ClientError- A higher level error.
-
getCredentials
public Map<PublicKeyCredentialDescriptor,PublicKeyCredentialUserEntity> getCredentials(String rpId) throws IOException, com.yubico.yubikit.core.application.CommandException, ClientError Get resident key credentials stored for a particular RP.- Parameters:
rpId- The ID of the RP to get credentials for.- Returns:
- A mapping between
PublicKeyCredentialDescriptors to their associatedPublicKeyCredentialUserEntity - Throws:
IOException- A communication error in the transport layer.com.yubico.yubikit.core.application.CommandException- A communication in the protocol layer.ClientError- A higher level error.
-
deleteCredential
public void deleteCredential(PublicKeyCredentialDescriptor credential) throws IOException, com.yubico.yubikit.core.application.CommandException, ClientError Delete a stored credential from the YubiKey.- Parameters:
credential- APublicKeyCredentialDescriptorwhich can be gotten fromgetCredentials(String).- Throws:
IOException- A communication error in the transport layer.com.yubico.yubikit.core.application.CommandException- A communication in the protocol layer.ClientError- A higher level error.
-