Java Code Examples for org.springframework.security.saml.key.JKSKeyManager

The following examples show how to use org.springframework.security.saml.key.JKSKeyManager. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
/**
 * Used to load .Jks file
 * 
 * @return
 */
@Bean
@Conditional(InsightsSAMLBeanInitializationCondition.class)
public KeyManager keyManager() {
	Resource storeFile = resourceLoaderService.getResource("file:" + singleSignOnConfig.getKeyStoreFilePath());
	Map<String, String> passwords = new HashMap<>();
	passwords.put(singleSignOnConfig.getKeyAlias(), singleSignOnConfig.getKeyPass());
	return new JKSKeyManager(storeFile, singleSignOnConfig.getKeyStorePass(), passwords,
			singleSignOnConfig.getKeyAlias());
}
 
Example 2
Source Project: spring-tsers-auth   Source File: WebSecurityConfig.java    License: Apache License 2.0 5 votes vote down vote up
@Bean
public KeyManager keyManager() {
    DefaultResourceLoader loader = new DefaultResourceLoader();
    Resource storeFile = loader
            .getResource("classpath:/saml/samlKeystore.jks");
    String storePass = "nalle123";
    Map<String, String> passwords = new HashMap<String, String>();
    passwords.put("apollo", "nalle123");
    String defaultKey = "apollo";
    return new JKSKeyManager(storeFile, storePass, passwords, defaultKey);
}
 
Example 3
@Bean
public KeyManager keyManager() {
    DefaultResourceLoader loader = new DefaultResourceLoader();
    Resource storeFile = loader
            .getResource("classpath:/saml/samlKeystore.jks");
    String storePass = "nalle123";
    Map<String, String> passwords = new HashMap<String, String>();
    passwords.put("apollo", "nalle123");
    String defaultKey = "apollo";
    return new JKSKeyManager(storeFile, storePass, passwords, defaultKey);
}
 
Example 4
Source Project: spring-boot-security-saml-samples   Source File: SAMLConfig.java    License: MIT License 4 votes vote down vote up
@Bean
public KeyManager keyManager(KeystoreFactory keystoreFactory) {
    KeyStore keystore = keystoreFactory.loadKeystore("classpath:/localhost.cert", "classpath:/localhost.key.der", "localhost", "");
    return new JKSKeyManager(keystore, ImmutableMap.of("localhost", ""), "localhost");
}