Interface KeyStore

  • All Known Implementing Classes:
    HibernateKeyStoreDao

    @ParametersAreNonnullByDefault
    @ReturnValuesAreNonnullByDefault
    public interface KeyStore
    A simple keystore supporting the retrieval and storage of public keys and public/private key pairs.

    A key store may choose whether to allow the updating of existing keys.

    • Method Detail

      • getPrivateKey

        @Nullable PrivateKey getPrivateKey​(String alias)
        Parameters:
        alias - Key alias
        Returns:
        private key for this alias or null if no such key exists
      • getPublicKey

        @Nullable PublicKey getPublicKey​(String alias)
        Parameters:
        alias - Key alias
        Returns:
        public key for this alias or null if no such key exists
      • getKeyPair

        @Nullable KeyPair getKeyPair​(String alias)
        Returns a key pair for a specified alias. If there isn't a public/private key pair for the alias null will be returned. This is also true if there is only a public key stored for the alias.
        Parameters:
        alias - Key alias
        Returns:
        Key pair for this alias or null if a pair of keys exists
      • storeKeyPair

        void storeKeyPair​(String alias,
                          KeyPair keyPair)
        Stores a key pair against a key alias. Whether a key store supports updating existing keys forms is left to the key store implementation.
        Parameters:
        alias - Key alias
        keyPair - Key pair to store
      • storePublicKey

        void storePublicKey​(String alias,
                            @Nullable PublicKey publicKey)
        Stores a public key against a key alias.
        Parameters:
        alias - Key alias
        publicKey - Key pair to store