Package org.keycloak.common.util
Class KeystoreUtil
java.lang.Object
org.keycloak.common.util.KeystoreUtil
- Version:
- $Revision: 1 $
- Author:
- Bill Burke
-
Nested Class Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic Optional<KeystoreUtil.KeystoreFormat>
getKeystoreFormat
(String path) static String
getKeystoreType
(String preferredType, String path, String defaultType) Try to return supported keystore typestatic KeyPair
loadKeyPairFromKeystore
(String keystoreFile, String storePassword, String keyPassword, String keyAlias, KeystoreUtil.KeystoreFormat format) static KeyStore
loadKeyStore
(String filename, String password) static KeyStore
loadKeyStore
(String filename, String password, String preferedType)
-
Constructor Details
-
KeystoreUtil
public KeystoreUtil()
-
-
Method Details
-
loadKeyStore
- Throws:
Exception
-
loadKeyStore
public static KeyStore loadKeyStore(String filename, String password, String preferedType) throws Exception - Throws:
Exception
-
loadKeyPairFromKeystore
-
getKeystoreFormat
-
getKeystoreType
Try to return supported keystore type- Parameters:
preferredType
- The preferred format - usually the one from the configuration. When present, it should be preferred over anything elsepath
- Path of the file. We can try to detect keystore type from that (EG. my-keystore.pkcs12 will return "pkcs12") in case that preferredType is not defineddefaultType
- Default format as last fallback when none of the above can be used. Should be non-null- Returns:
- format as specified above
-