public interface KeyStoreService
| Modifier and Type | Method and Description |
|---|---|
void |
addPasswordBasedSecretKey(KeyStoreAccess keyStoreAccess,
String alias,
char[] secretToStore)
Adds password-like secret key to keystore.
|
KeyStore |
createKeyStore(KeyStoreAuth keyStoreAuth,
KeyCreationConfig config)
Creates keystore.
|
KeyStore |
createKeyStore(KeyStoreAuth keyStoreAuth,
KeyCreationConfig config,
Map<KeyID,Optional<SecretKeyEntry>> secretKeys)
Creates keystore that has additional secret keys in it.
|
KeyStore |
deserialize(byte[] payload,
ReadStorePassword password)
Reads encrypted keystore from its byte representation - decryption is done using
KeyStoreAuth.getReadStorePassword() |
PrivateKey |
getPrivateKey(KeyStoreAccess keyStoreAccess,
KeyID keyID)
Reads private key from the keystore.
|
List<PublicKeyIDWithPublicKey> |
getPublicKeys(KeyStoreAccess keyStoreAccess)
Reads public keys from the keystore.
|
SecretKeySpec |
getSecretKey(KeyStoreAccess keyStoreAccess,
KeyID keyID)
Reads secret key from the keystore.
|
void |
removeKey(KeyStoreAccess keyStoreAccess,
String alias)
Removes key that is identified by
alias from keystore. |
byte[] |
serialize(KeyStore store,
ReadStorePassword password)
Converts keystore into bytes, they are safe to be store/transferred because of encryption using
KeyStoreAuth.getReadStorePassword() |
KeyStore |
updateKeyStoreReadKeyPassword(KeyStore current,
KeyStoreAuth currentCredentials,
KeyStoreAuth newCredentials)
Updates keystore access credentials and returns new keystore with new credentials.
|
KeyStore createKeyStore(KeyStoreAuth keyStoreAuth, KeyCreationConfig config)
keyStoreAuth - Keys for opening keystore and reading key from itconfig - Keystore will be pre-populated with keys according to itKeyStore createKeyStore(KeyStoreAuth keyStoreAuth, KeyCreationConfig config, Map<KeyID,Optional<SecretKeyEntry>> secretKeys)
keyStoreAuth - Keys for opening keystore and reading key from itconfig - Keystore will be pre-populated with keys according to itsecretKeys - Secret keys to store in keystore, if value is empty - key will be generatedKeyStore updateKeyStoreReadKeyPassword(KeyStore current, KeyStoreAuth currentCredentials, KeyStoreAuth newCredentials)
current - Original keystorecurrentCredentials - Oriignal keystore credentialsnewCredentials - New credentials to useList<PublicKeyIDWithPublicKey> getPublicKeys(KeyStoreAccess keyStoreAccess)
keyStoreAccess - Key to open keystore (only KeyStoreAuth.getReadStorePassword() is used)PrivateKey getPrivateKey(KeyStoreAccess keyStoreAccess, KeyID keyID)
keyStoreAccess - Key to open keystore and read key, (both
KeyStoreAuth.getReadStorePassword() and KeyStoreAuth.getReadKeyPassword() are used)keyID - Private key ID to readSecretKeySpec getSecretKey(KeyStoreAccess keyStoreAccess, KeyID keyID)
keyStoreAccess - Key to open keystore and read key, (both
KeyStoreAuth.getReadStorePassword() and KeyStoreAuth.getReadKeyPassword() are used)keyID - Secret key ID to readvoid addPasswordBasedSecretKey(KeyStoreAccess keyStoreAccess, String alias, char[] secretToStore)
keyStoreAccess - Keystore with its access detailsalias - Key alias to addsecretToStore - Key value to store in keystore (in keyStoreAccess)void removeKey(KeyStoreAccess keyStoreAccess, String alias)
alias from keystore.keyStoreAccess - Keystore with its access detailsalias - Key alias to removebyte[] serialize(KeyStore store, ReadStorePassword password)
KeyStoreAuth.getReadStorePassword()store - Keystore that will be serializedpassword - Encrypts byte sequenceKeyStore deserialize(byte[] payload, ReadStorePassword password)
KeyStoreAuth.getReadStorePassword()payload - Bytes to read frompassword - Decrypts byte sequenceCopyright © 2019. All rights reserved.