Package org.apache.ofbiz.base.util
Class KeyStoreUtil
java.lang.Object
org.apache.ofbiz.base.util.KeyStoreUtil
KeyStoreUtil - Utilities for getting KeyManagers and TrustManagers
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
certToString
(Certificate cert) static KeyStore
getComponentKeyStore
(String componentName, String keyStoreName) static KeyStore
static KeyStore
static KeyStore
getX500Map
(Principal x500) static void
importPKCS8CertChain
(KeyStore ks, String alias, byte[] keyBytes, String keyPass, byte[] certChain) static Certificate
static Certificate
pemToCert
(InputStream is) static Certificate
static Certificate
static String
pemToPkHex
(String certString) static X509Certificate
readCertificate
(byte[] certChain) static void
storeComponentKeyStore
(String componentName, String keyStoreName, KeyStore store)
-
Method Details
-
storeComponentKeyStore
public static void storeComponentKeyStore(String componentName, String keyStoreName, KeyStore store) throws IOException, GenericConfigException, NoSuchAlgorithmException, CertificateException, KeyStoreException -
getComponentKeyStore
public static KeyStore getComponentKeyStore(String componentName, String keyStoreName) throws IOException, GeneralSecurityException, GenericConfigException -
getStore
public static KeyStore getStore(URL url, String password) throws IOException, GeneralSecurityException - Throws:
IOException
GeneralSecurityException
-
getStore
public static KeyStore getStore(URL url, String password, String type) throws IOException, GeneralSecurityException - Throws:
IOException
GeneralSecurityException
-
getSystemTrustStore
- Throws:
IOException
GeneralSecurityException
-
readCertificate
- Throws:
CertificateException
-
getCertX500Map
-
getX500Map
-
importPKCS8CertChain
public static void importPKCS8CertChain(KeyStore ks, String alias, byte[] keyBytes, String keyPass, byte[] certChain) throws InvalidKeySpecException, NoSuchAlgorithmException, CertificateException, KeyStoreException -
certToString
- Throws:
CertificateEncodingException
-
pemToCert
- Throws:
IOException
CertificateException
-
pemToCert
- Throws:
IOException
CertificateException
-
pemToCert
- Throws:
IOException
CertificateException
-
pemToCert
- Throws:
IOException
CertificateException
-
pemToPkHex
- Throws:
IOException
CertificateException
-