Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package com.google.code.springcryptoutils.core.keystore;
 
 
A spring bean factory for instancing the default KeyStore object using the system properties:
  • javax.net.ssl.keyStore
  • javax.net.ssl.keyStorePassword

Author(s):
Mirko Caserta (mirko.caserta@gmail.com)
    private KeyStore keystore;
    public Object getObject() {
        return ;
    }
    public Class getObjectType() {
        return KeyStore.class;
    }
    public boolean isSingleton() {
        return true;
    }
        final String keyStoreLocation = System.getProperty("javax.net.ssl.keyStore");
        
        if (keyStoreLocation == null || keyStoreLocation.trim().length() == 0) {
            throw new InitializationException("no value was specified for the system property: javax.net.ssl.keyStore");
        }
        final String password = System.getProperty("javax.net.ssl.keyStorePassword");
        final Resource location = new FileSystemResource(keyStoreLocation);
         = KeyStore.getInstance("JKS");
        .load(location.getInputStream(), password.toCharArray());
    }
New to GrepCode? Check out our FAQ X