Package io.token.security.keystore
Class KeyStoreFactory
- java.lang.Object
-
- io.token.security.keystore.KeyStoreFactory
-
public abstract class KeyStoreFactory extends java.lang.Object
Helper methods to parse security related configuration.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static SecretKeyPair
createSecretKeyPair(com.typesafe.config.Config config)
Parses a private key from config.static SecretKeyPair
createSecretKeyPair(java.lang.String publicKey, java.lang.String privateKey, java.lang.String algorithm, boolean isActive)
Creates a key pair using given params.static SecretKeyStore
createSecretKeyStore(java.util.List<? extends com.typesafe.config.Config> config)
Creates secret key store configured based on the passed in config.static SecretKeyStore
createSecretKeyStoreFromKeys(java.util.List<SecretKeyPair> keys)
Creates secret key store configured based on the passed in AuthConfig proto.static TrustedKeyStore
createTrustedKeyStore(java.util.List<? extends com.typesafe.config.Config> config)
Creates trusted key store configured based on the passed in config.static Crypto
cryptoFor(CryptoType cryptoType)
Returns crypto that matches the specified algorithm.
-
-
-
Method Detail
-
cryptoFor
public static Crypto cryptoFor(CryptoType cryptoType)
Returns crypto that matches the specified algorithm.- Parameters:
cryptoType
- crypto type- Returns:
- crypto implementation
-
createSecretKeyStore
public static SecretKeyStore createSecretKeyStore(java.util.List<? extends com.typesafe.config.Config> config)
Creates secret key store configured based on the passed in config.- Parameters:
config
- config to extract the keys from- Returns:
- secret key store
-
createSecretKeyStoreFromKeys
public static SecretKeyStore createSecretKeyStoreFromKeys(java.util.List<SecretKeyPair> keys)
Creates secret key store configured based on the passed in AuthConfig proto.- Parameters:
keys
- a list of keys- Returns:
- secret key store
-
createSecretKeyPair
public static SecretKeyPair createSecretKeyPair(com.typesafe.config.Config config)
Parses a private key from config.- Parameters:
config
- the config to be parsed- Returns:
- secret key pair
-
createSecretKeyPair
public static SecretKeyPair createSecretKeyPair(java.lang.String publicKey, java.lang.String privateKey, java.lang.String algorithm, boolean isActive)
Creates a key pair using given params.- Parameters:
publicKey
- public key stringprivateKey
- private key stringalgorithm
- key algorithmisActive
- true if key is active- Returns:
- a private key
-
createTrustedKeyStore
public static TrustedKeyStore createTrustedKeyStore(java.util.List<? extends com.typesafe.config.Config> config)
Creates trusted key store configured based on the passed in config.- Parameters:
config
- config to extract the keys from- Returns:
- trusted key store
-
-