eu.emi.client.security.util
Class KeystoreUtil
java.lang.Object
eu.emi.client.security.util.KeystoreUtil
public class KeystoreUtil
- extends Object
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
getDefaultKeyAlias
public static String getDefaultKeyAlias(ISecurityProperties sec)
throws KeyStoreException,
NoSuchAlgorithmException,
CertificateException,
IOException
- Throws:
KeyStoreException
NoSuchAlgorithmException
CertificateException
IOException
createKeyStore
public static KeyStore createKeyStore(String name,
String passwd,
String type)
throws KeyStoreException,
NoSuchAlgorithmException,
CertificateException,
IOException
- Throws:
KeyStoreException
NoSuchAlgorithmException
CertificateException
IOException
getTrustedCertDNs
public static String[] getTrustedCertDNs(KeyStore ks)
throws KeyStoreException
- Throws:
KeyStoreException
loadKeyStore
public static KeyStore loadKeyStore(String name,
String passwd,
String type)
throws KeyStoreException,
NoSuchAlgorithmException,
CertificateException,
IOException
- loads keystore from a file
TODO this code can be replaced by the future authn lib
- Parameters:
name - - the file namepasswd - - the passwordtype - - the type (jks, pkcs12). If not given, it will be attempted to infer
the type from the filename. If impossible, jks and p12 will be tried
- Returns:
- keystore
- Throws:
KeyStoreException
NoSuchAlgorithmException
CertificateException
IOException
loadTruststore
public static KeyStore loadTruststore(String file,
String password,
String type)
throws KeyStoreException,
CertificateException,
IOException,
NoSuchAlgorithmException
- loads a truststore
TODO this code can be replaced by the future authn lib
- Parameters:
file - - the file namepassword - - the password (if required)type - - the optional type (jks, pkcs12, pem, directory)
- Returns:
-
- Throws:
KeyStoreException
CertificateException
IOException
NoSuchAlgorithmException
Copyright © 2012 EMI. All Rights Reserved.