Class AbstractKeyStoreTokenConnection

java.lang.Object
eu.europa.esig.dss.token.AbstractSignatureTokenConnection
eu.europa.esig.dss.token.AbstractKeyStoreTokenConnection
All Implemented Interfaces:
SignatureTokenConnection, AutoCloseable
Direct Known Subclasses:
KeyStoreSignatureTokenConnection, MSCAPISignatureToken, Pkcs11SignatureToken

public abstract class AbstractKeyStoreTokenConnection
extends AbstractSignatureTokenConnection
The keyStore token connection
  • Constructor Details

    • AbstractKeyStoreTokenConnection

      public AbstractKeyStoreTokenConnection()
  • Method Details

    • getKeys

      public List<DSSPrivateKeyEntry> getKeys() throws DSSException
      Description copied from interface: SignatureTokenConnection
      Retrieves all the available keys (private keys entries) from the token.
      Returns:
      List of encapsulated private keys
      Throws:
      DSSException - If there is any problem during the retrieval process
    • getKey

      public DSSPrivateKeyEntry getKey​(String alias)
      This method allows to retrieve a DSSPrivateKeyEntry by alias
      Parameters:
      alias - the expected entry alias
      Returns:
      the private key or null if the alias does not exist
    • getKey

      public DSSPrivateKeyEntry getKey​(String alias, KeyStore.PasswordProtection passwordProtection)
      This method allows to retrieve a DSSPrivateKeyEntry by alias
      Parameters:
      alias - the expected entry alias
      passwordProtection - key password
      Returns:
      the private key or null if the alias does not exist