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
Modifier and TypeMethodDescription@Nullable KeyPairgetKeyPair(String alias) Returns a key pair for a specified alias.@Nullable PrivateKeygetPrivateKey(String alias) @Nullable PublicKeygetPublicKey(String alias) voidstoreKeyPair(String alias, KeyPair keyPair) Stores a key pair against a key alias.voidstorePublicKey(String alias, @Nullable PublicKey publicKey) Stores a public key against a key alias.
-
Method Details
-
getPrivateKey
- Parameters:
alias- Key alias- Returns:
- private key for this alias or null if no such key exists
-
getPublicKey
- Parameters:
alias- Key alias- Returns:
- public key for this alias or null if no such key exists
-
getKeyPair
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
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
-
storePublicKey
Stores a public key against a key alias.- Parameters:
alias- Key aliaspublicKey- Key pair to store
-