Class CredentialManager

java.lang.Object
com.yubico.yubikit.fido.client.CredentialManager

public class CredentialManager extends Object
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 Details

    • getCredentialCount

      public int getCredentialCount() throws IOException, com.yubico.yubikit.core.application.CommandException, ClientError
      Get 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, ClientError
      Get 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 associated PublicKeyCredentialUserEntity
      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 - A PublicKeyCredentialDescriptor which can be gotten from 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.