Class HibernateKeyStoreDao
java.lang.Object
com.atlassian.confluence.security.persistence.dao.hibernate.HibernateKeyStoreDao
- All Implemented Interfaces:
KeyStore
@ParametersAreNonnullByDefault
@ReturnValuesAreNonnullByDefault
@Transactional
public class HibernateKeyStoreDao
extends Object
implements KeyStore
Hibernate implementation of the
KeyStore
interface-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription@Nullable KeyPair
getKeyPair
(String alias) Returns a key pair for a specified alias.getPrivateKey
(String alias) 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.
-
Constructor Details
-
HibernateKeyStoreDao
public HibernateKeyStoreDao(org.hibernate.SessionFactory sessionFactory)
-
-
Method Details
-
getPrivateKey
- Specified by:
getPrivateKey
in interfaceKeyStore
- Parameters:
alias
- Key alias- Returns:
- private key for this alias or null if no such key exists
-
getPublicKey
- Specified by:
getPublicKey
in interfaceKeyStore
- Parameters:
alias
- Key alias- Returns:
- public key for this alias or null if no such key exists
-
getKeyPair
Description copied from interface:KeyStore
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.- Specified by:
getKeyPair
in interfaceKeyStore
- Parameters:
alias
- Key alias- Returns:
- Key pair for this alias or null if a pair of keys exists
-
storeKeyPair
Description copied from interface:KeyStore
Stores a key pair against a key alias. Whether a key store supports updating existing keys forms is left to the key store implementation.- Specified by:
storeKeyPair
in interfaceKeyStore
- Parameters:
alias
- Key aliaskeyPair
- Key pair to store
-
storePublicKey
Description copied from interface:KeyStore
Stores a public key against a key alias.- Specified by:
storePublicKey
in interfaceKeyStore
- Parameters:
alias
- Key aliaspublicKey
- Key pair to store
-