public interface KeyStoreService
| Modifier and Type | Method and Description |
|---|---|
KeyStore |
createKeyStore(KeyStoreAuth keyStoreAuth,
KeyStoreType keyStoreType,
KeyStoreCreationConfig config)
Creates keystore.
|
KeyStore |
createKeyStore(KeyStoreAuth keyStoreAuth,
KeyStoreType keyStoreType,
KeyStoreCreationConfig config,
Map<KeyID,Optional<SecretKeyEntry>> secretKeys)
Creates keystore that has additional secret keys in it.
|
KeyStore |
deserialize(byte[] payload,
String storeId,
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.
|
byte[] |
serialize(KeyStore store,
String storeId,
ReadStorePassword password)
Converts keystore into bytes, they are safe to be store/transferred because of encryption using
KeyStoreAuth.getReadStorePassword() |
KeyStore createKeyStore(KeyStoreAuth keyStoreAuth, KeyStoreType keyStoreType, KeyStoreCreationConfig config)
keyStoreAuth - Keys for opening keystore and reading key from itkeyStoreType - Keystore type, example: PKCS or PKCS12 or JKSconfig - Keystore will be pre-populated with keys according to itKeyStore createKeyStore(KeyStoreAuth keyStoreAuth, KeyStoreType keyStoreType, KeyStoreCreationConfig config, Map<KeyID,Optional<SecretKeyEntry>> secretKeys)
keyStoreAuth - Keys for opening keystore and reading key from itkeyStoreType - Keystore type, example: PKCS12 or UBER or JKSconfig - Keystore will be pre-populated with keys according to itsecretKeys - Secret keys to store in keystore, if value is empty - key will be generatedList<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 readbyte[] serialize(KeyStore store, String storeId, ReadStorePassword password)
KeyStoreAuth.getReadStorePassword()store - Keystore that will be serializedstoreId - Assign ID to serialized keystorepassword - Encrypts byte sequenceKeyStore deserialize(byte[] payload, String storeId, ReadStorePassword password)
KeyStoreAuth.getReadStorePassword()payload - Bytes to read fromstoreId - Specifies which keystore to read from bytespassword - Decrypts byte sequenceCopyright © 2019. All rights reserved.