
br.com.esec.icpm.signer.security.CryptoProvider Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of security-helper Show documentation
Show all versions of security-helper Show documentation
This library is used to help with HTTP with SSL auth client and WS-Secutiry.
The newest version!
package br.com.esec.icpm.signer.security;
import java.io.IOException;
import java.util.Properties;
import org.apache.ws.security.components.crypto.CredentialException;
import org.apache.ws.security.components.crypto.Merlin;
import org.apache.ws.security.util.Loader;
public class CryptoProvider extends Merlin {
public CryptoProvider() {}
/**
* @see Merlin#Merlin(Properties)
* @param properties
* @throws CredentialException
* @throws IOException
*/
public CryptoProvider(Properties properties) throws CredentialException, IOException {
super(overrideProperties(properties), Loader.getClassLoader(CryptoProvider.class));
}
/**
* @see Merlin#Merlin(Properties, ClassLoader)
* @param properties
* @param loader
* @throws CredentialException
* @throws IOException
*/
public CryptoProvider(Properties properties, ClassLoader loader) throws CredentialException, IOException {
super(overrideProperties(properties), loader);
}
/**
* Write the password in the properties after loaded, so we don't need to save it to disk.
*
* @param src
* @return
* @throws IOException
*/
private static Properties overrideProperties(Properties src) throws IOException {
Properties over = SecurityConfig.getConfig();
for (String p : over.stringPropertyNames()) {
src.setProperty(p, over.getProperty(p));
}
return src;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy