Hi Hermann,

The problem is that you have not set the *alias* of the private key as
the value of the "user" parameter. [1]

The value you have given now is "hermann".
        w.setOption(WSHandlerConstants.USER, "hermann");

You can find the alias of the private key using the keytool

$ keytool -list -v -keystore path/to/x509pri.p12 -storepass 1234567890
-storetype pkcs12

Take a look at the entries of type "KeyEntry" as shown below and use
the "Alias name" value of that particular key that you want to use.

Alias name: alice
Creation date: Jun 5, 2005
Entry type: keyEntry

If that fails I suggest you can give it another try by using the SHA1
certificate fingerprint (lowercase letters without colons) of the
public key cert of the particular key that you want to use. This is
also available in the output of "keytool -list -v"

HTH

Thanks,
Ruchith

[1] http://www.wso2.net/kb/116

On 6/26/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:




Hi All,

 I've create a client that send a certificate with the message, I've a
problem with certificate.

 I've a keystore pcks12 given me by a CA now I've configured the client in
order to sign message , I ve created a class that set the option of client

 package PerformWSSecurity;

 import java.util.Hashtable;

 import org.apache.axis.AxisEngine;
 import org.apache.axis.ConfigurationException;
 import org.apache.axis.SimpleTargetedChain;
 import org.apache.axis.configuration.SimpleProvider;
 import org.apache.ws.axis.security.WSDoAllSender;
 import org.apache.ws.security.handler.WSHandlerConstants;


 public class MyEngineConfiguration extends SimpleProvider {

     public MyEngineConfiguration() {
         super();

         this.deployTransport("http", new SimpleTargetedChain(new
org.apache.axis.transport.http.HTTPSender()));
        //parameters
         Hashtable<String, Object> opts = new Hashtable<String, Object>();
         opts.put(AxisEngine.PROP_DISABLE_PRETTY_XML,
Boolean.TRUE);
         this.setGlobalOptions(opts);
        //requestFlow
        org.apache.ws.axis.security.WSDoAllSender w = new
WSDoAllSender();
        w.setOption(WSHandlerConstants.SIG_PROP_FILE,
"cryptoSender.properties");
        w.setOption(WSHandlerConstants.SIG_KEY_ID, "DirectReference");
        w.setOption(WSHandlerConstants.USER, "hermann");

w.setOption(WSHandlerConstants.PW_CALLBACK_CLASS,"PWCallback");
        w.setOption(WSHandlerConstants.ACTION,
WSHandlerConstants.SIGNATURE);
        this.setGlobalResponse(w);

     }

     @Override
     public void configureEngine(AxisEngine engine) throws
 ConfigurationException {
         engine.refreshGlobalOptions();
     }
 }

 ant this is cryptoSender.properties

org.apache.ws.security.crypto.provider=org.apache.ws.security.components.crypto.Merlin
 org.apache.ws.security.crypto.merlin.file=x509pri.p12
 org.apache.ws.security.crypto.merlin.keystore.type=PKCS12
org.apache.ws.security.crypto.merlin.keystore.password=1234567890

 now the problem is that when I run my main class I return this exception

 org.apache.ws.security.WSSecurityException: WSHandler:
Signature: error during message
procesingorg.apache.ws.security.WSSecurityException:
General security error (Unexpected number of X509Data: for Signature)

 I don't understand which kind of error is this I think that It doesn't read
the certificate in the keystore,

 How can I set the properties in order to read certificate?

 Thanks a lot

 Hermann



--
www.ruchith.org

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to