Spring Web Services Framework

org.springframework.ws.soap.security.support
Class KeyStoreUtils

java.lang.Object
  extended by org.springframework.ws.soap.security.support.KeyStoreUtils

public abstract class KeyStoreUtils
extends Object

Generic utility methods for dealing with KeyStore objects.

Since:
1.5.0
Author:
Arjen Poutsma

Constructor Summary
KeyStoreUtils()
           
 
Method Summary
static KeyStore loadDefaultKeyStore()
          Loads the key store indicated by system properties.
static KeyStore loadDefaultTrustStore()
          Loads a default trust store.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

KeyStoreUtils

public KeyStoreUtils()
Method Detail

loadDefaultKeyStore

public static KeyStore loadDefaultKeyStore()
                                    throws GeneralSecurityException,
                                           IOException
Loads the key store indicated by system properties. This method tries to load a key store by consulting the following system properties:javax.net.ssl.keyStore, javax.net.ssl.keyStorePassword, and javax.net.ssl.keyStoreType.

If these properties specify a file with an appropriate password, the factory uses this file for the key store. If that file does not exist, then a default, empty keystore is created.

This behavior corresponds to the standard J2SDK behavior for SSL key stores.

Throws:
GeneralSecurityException
IOException
See Also:
The standard J2SDK SSL key store mechanism

loadDefaultTrustStore

public static KeyStore loadDefaultTrustStore()
                                      throws GeneralSecurityException,
                                             IOException
Loads a default trust store. This method uses the following algorithm:
  1. If the system property javax.net.ssl.trustStore is defined, its value is loaded. If the javax.net.ssl.trustStorePassword system property is also defined, its value is used as a password. If the javax.net.ssl.trustStoreType system property is defined, its value is used as a key store type.

    If javax.net.ssl.trustStore is defined but the specified file does not exist, then a default, empty trust store is created.

  2. If the javax.net.ssl.trustStore system property was not specified, but if the file $JAVA_HOME/lib/security/jssecacerts exists, that file is used.
  3. Otherwise,
  4. If the file $JAVA_HOME/lib/security/cacerts exists, that file is used.

This behavior corresponds to the standard J2SDK behavior for SSL trust stores.

Throws:
GeneralSecurityException
IOException
See Also:
The standard J2SDK SSL trust store mechanism

Spring Web Services Framework

Copyright © 2005-2010 The Spring Web Services Framework. All Rights Reserved.