|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecteu.xtreemos.xosd.utilities.security.ServiceTrustStore
public class ServiceTrustStore
Provides tools for checking the validity of the certificates inside service calls.
Field Summary | |
---|---|
private static java.lang.String |
clientCertificateFile
These are for testing purposes. |
private static java.lang.String |
localTrustStore
|
(package private) static org.apache.log4j.Logger |
logger
|
private static java.lang.String |
serverCertificateFile
|
private javax.net.ssl.TrustManager[] |
trustManagers
|
private static java.security.KeyStore |
trustStore
|
Constructor Summary | |
---|---|
ServiceTrustStore()
|
Method Summary | |
---|---|
static boolean |
checkValidity(java.security.cert.X509Certificate clientCertificate)
Method checks validity of the clientCertificate cert with the KeyStore initiated using initiateTrustStore(HashMap) method. |
private javax.net.ssl.SSLContext |
createTruestContext(java.security.cert.X509Certificate cdaCert)
Creating context which provides secure sockets for the CDA server connection used in connectToCDA method. |
private javax.net.ssl.TrustManager[] |
createTrustManagers(java.security.KeyStore trustStore)
Initialize trust manager. |
private java.security.KeyStore |
createTrustStore(java.security.cert.X509Certificate trustedServerCertificate,
java.lang.String alias)
This creates KeyStore into which trustedServerCertificate is added as trusted key certificate. |
private static java.util.HashMap<java.lang.String,java.security.cert.X509Certificate> |
getCertMap(java.io.File policyStorageDirectory)
Reads a directory for PEM certificates and ads them to hashmap (with aliases). |
static java.security.KeyStore |
getTrustedCertKeyStore()
Retrieve the keystore containing the trusted certificates. |
static java.security.KeyStore |
getTrustedCertKeyStore(java.lang.String path)
Retrieve a custom keystore containing certificates in a provided path. |
static void |
initiate(java.lang.String pathToTrustStore)
Calls getCertMap(File) and initiateTrustStore(HashMap)
respectively. |
private static java.security.KeyStore |
initiateTrustStore(java.util.HashMap<java.lang.String,java.security.cert.X509Certificate> certMap)
Initiates KeyStore with certificates, provided with certMap parameter. |
static void |
main(java.lang.String[] args)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
static org.apache.log4j.Logger logger
private javax.net.ssl.TrustManager[] trustManagers
private static java.security.KeyStore trustStore
private static java.lang.String clientCertificateFile
private static java.lang.String serverCertificateFile
private static java.lang.String localTrustStore
Constructor Detail |
---|
public ServiceTrustStore()
Method Detail |
---|
private static java.util.HashMap<java.lang.String,java.security.cert.X509Certificate> getCertMap(java.io.File policyStorageDirectory) throws java.lang.Exception
java.lang.Exception
private static java.security.KeyStore initiateTrustStore(java.util.HashMap<java.lang.String,java.security.cert.X509Certificate> certMap) throws java.lang.Exception
HashMap
- containing aliases and public certificates.
java.lang.Exception
public static void initiate(java.lang.String pathToTrustStore) throws java.lang.Exception
getCertMap(File)
and initiateTrustStore(HashMap)
respectively.
pathToTrustStore
- path to keystore.
java.lang.Exception
public static boolean checkValidity(java.security.cert.X509Certificate clientCertificate) throws java.lang.Exception
initiateTrustStore(HashMap)
method.
trustedServerCertificate
- clientCertificate
-
java.lang.Exception
private java.security.KeyStore createTrustStore(java.security.cert.X509Certificate trustedServerCertificate, java.lang.String alias)
trustedServerCertificate
- alias
- for the certificate
private javax.net.ssl.TrustManager[] createTrustManagers(java.security.KeyStore trustStore)
trustStore
-
private javax.net.ssl.SSLContext createTruestContext(java.security.cert.X509Certificate cdaCert)
cdaCert
- Certificate to use as handshake certificate.
public static java.security.KeyStore getTrustedCertKeyStore()
public static java.security.KeyStore getTrustedCertKeyStore(java.lang.String path) throws java.lang.Exception
getTrustedCertKeyStore()
, this call actually reads
the certificate files in each call.
path
- The path containing the certificates of the trusted CAs.
java.lang.Exception
public static void main(java.lang.String[] args) throws java.lang.Exception
args
-
java.lang.Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |