use of com.adaptris.security.keystore.InlineKeystore in project interlok by adaptris.
the class TestInlineKeystore method setUp.
@Override
@Before
public void setUp() throws Exception {
config = Config.getInstance();
inline = new InlineKeystore();
inline.setCertificate(EXAMPLE_KEYINFO);
inline.setType(Constants.KEYSTORE_XMLKEYINFO);
inline.setAlias("MyAlias");
copy = new InlineKeystore();
copy.setCertificate(EXAMPLE_KEYINFO);
copy.setType(Constants.KEYSTORE_XMLKEYINFO);
copy.setAlias("MyAlias");
kloc = inline.asKeystoreLocation();
}
use of com.adaptris.security.keystore.InlineKeystore in project interlok by adaptris.
the class EncryptionServiceCase method applyConfigForSamples.
protected static void applyConfigForSamples(CoreSecurityService service) {
try {
service.setLocalPartner("local partner alias in keystore");
service.setRemotePartner("remote partner alias in keystore");
service.addKeystoreUrl(new ConfiguredUrl("http://localhost/path/to/JKS/keystore?keystoreType=" + "JKS&keystorePassword=somePlainTextPassword"));
service.addKeystoreUrl(new ConfiguredUrl("file://localhost/path/to/a/X509/Certificate?keystoreType=" + "X509?keystoreAlias=CertificateAlias"));
service.addKeystoreUrl(new ConfiguredUrl("file://localhost/path/to/another/X509/Certificate?keystoreType=" + "X509?keystoreAlias=AnotherAlias"));
service.addKeystoreUrl(new ConfiguredUrl("http://host/path/to/a/PKCS12/Keystore?keystoreType=" + "PKCS12&keystoreAlias=PKCS12Alias", "PW:AAAAEF+zZCbvHeIXDx8HUslqiYwAAAAQ3wi4/BVycX+uzc5zF4F6EQAAABD0hhpr46IrKSu7XxFhEAYN"));
// service.addKeystoreUrl(new ConfiguredUrl("http://host/path/to/keystore?keystoreType=" + "PKCS12&keystoreAlias=myalias",
// PROPERTIES.getProperty(SECURITY_PASSWORD)));
service.addKeystoreUrl(new ConfiguredUrl("http://host/path/to/a/JCE/keystore?keystoreType=JCEKS", "ALTPW:AAAAEF+zZCbvHeIXDx8HUslqiYwAAAAQ3wi4/BVycX+uzc5zF4F6EQAAABD0hhpr46IrKSu7XxFhEAYN"));
// service.addKeystoreUrl(new ConfiguredUrl("http://host/path/to/keystore?keystoreType=" + "JCEKS&keystoreAlias=myalias",
// Password.encode(PROPERTIES.getProperty(SECURITY_PASSWORD), Password.NON_PORTABLE_PASSWORD)));
service.addKeystoreUrl(new ConfiguredUrl("file://local/path/to/anoter/JKS/keystore?keystoreType=" + "JKS&keystoreAlias=myalias", "somePlainTextPassword"));
InlineKeystore inline = new InlineKeystore();
inline.setCertificate(EXAMPLE_KEYINFO);
inline.setType(Constants.KEYSTORE_XMLKEYINFO);
inline.setAlias("myAlias");
service.addKeystoreUrl(inline);
addEncryptionAlgsForFactoryType(service);
} catch (Exception e) {
throw new RuntimeException(e);
}
}
Aggregations