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 Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description @Nullable KeyPair
getKeyPair(String alias)
Returns a key pair for a specified alias.@Nullable PrivateKey
getPrivateKey(String alias)
@Nullable PublicKey
getPublicKey(String alias)
void
storeKeyPair(String alias, KeyPair keyPair)
Stores a key pair against a key alias.void
storePublicKey(String alias, @Nullable PublicKey publicKey)
Stores a public key against a key alias.
-
-
-
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 aliaskeyPair
- Key pair to store
-
-