|
Thanks, Jason. With this method, I
still don’t know how I would make WSDoAllSender use the Crypto object
that CryptoFactory.getInstance() just returned. Do you know? Am I
missing something very obvious? Or did you write your own Axis handler
and are calling WSSignEnvelope.build() directly in it? Thanks again, Ever From: Weinberg, Jason
[mailto:[EMAIL PROTECTED] Ever, I use something along the
lines of the following to accomplish this. I had the same concern with password
and have build a custom cipher storage mechanism which is responsible for
storing such sensitive data in an encrypted form.
Crypto crypto = null;
Properties cryptoProperties = getJksCryptoProperties(); // Method imp follows
crypto =
CryptoFactory.getInstance(cryptoProperties.getProperty("org.apache.ws.security.crypto.provider"),
cryptoProperties); private Properties getCryptoProperties() {
Properties cryptoProperties = new
Properties();
String keystoreLocationKey =
"tsr.services.security.wsshandlerconfig." + configurationDetailsKey +
".keystore.location";
String keystorePasswordKey =
"tsr.services.security.wsshandlerconfig." + configurationDetailsKey +
".keystore.password";
String keystoreLocation = SecurityUtils.getValue(keystoreLocationKey);
String keystorePassword = SecurityUtils.getValue(keystorePasswordKey);
cryptoProperties.put("org.apache.ws.security.crypto.merlin.file",
keystoreLocation);
cryptoProperties.put("org.apache.ws.security.crypto.merlin.keystore.password",
keystorePassword);
cryptoProperties.put("org.apache.ws.security.crypto.provider",
"org.apache.ws.security.components.crypto.Merlin");
cryptoProperties.put("org.apache.ws.security.crypto.merlin.keystore.type",
"jks");
return cryptoProperties; } Hope it helps - Jay From: Hello. I am using WSDoAllSender. I know that I
can programmatically set the user and signature props file using the Stub
object. Can I also programmatically set the Properties passed to the
crypto (Merlin) object instead of reading them from the signature props
file? I am particularly interested in getting rid of the entry: org.apache.ws.security.crypto.merlin.keystore.password in the signature props file and moving it into code. Well, actually, I guess I could subclass Merlin and override
the constructor to override the password that’s there (if any) with
something else. Is that the only way or is there a “more
built-in” way? Thanks, Ever |
- Programmatically set crypto properties? Olano, Ever
- RE: Programmatically set crypto properties? Weinberg, Jason
- RE: Programmatically set crypto properties? Olano, Ever
- RE: Programmatically set crypto properties? Weinberg, Jason
