Apologies, that's not required actually, this will do the job:

secEngine.processSecurityHeader(doc, null, null, cryptoPub);

Maybe it's a deployment problem, do you have the bouncycastle jar on the
classpath?

Maybe try and see if the following works?

WSSecSignature builder = new WSSecSignature();
builder.setUserInfo("JJ", "JJ-Password");
Document doc = unsignedEnvelope.getAsDocument();
WSSecHeader secHeader = new WSSecHeader();
secHeader.insertSecurityHeader(doc);
Document signedDoc = builder.build(doc,
CryptoFactory.getInstance("lpriv.props"), secHeader);

...

WSSecurityEngine secEngine = new WSSecurityEngine();
secEngine.processSecurityHeader(doc, null, null,
CryptoFactory.getInstance("lpub.props"));

Where:

lpriv.props:

org.apache.ws.security.crypto.provider=org.apache.ws.security.components
.crypto.Merlin
org.apache.ws.security.crypto.merlin.keystore.type=jks
org.apache.ws.security.crypto.merlin.keystore.password=keyStorePassword
org.apache.ws.security.crypto.merlin.file=keys/PrivateKeystore.jks

lpub.props:

org.apache.ws.security.crypto.provider=org.apache.ws.security.components
.crypto.Merlin
org.apache.ws.security.crypto.merlin.keystore.type=jks
org.apache.ws.security.crypto.merlin.keystore.password=keyStorePassword
org.apache.ws.security.crypto.merlin.file=keys/PublicKeystore.jks

Colm.


-----Original Message-----
From: Lukasz L. [mailto:[email protected]] 
Sent: 30 January 2009 11:25
To: [email protected]
Subject: RE: Exception: DerInputStream.getLength(): lengthTag=119, too
big


do you mean providing alias password? no ...
as you advised in this thread
http://www.nabble.com/Signature-question-tt20978463.html
I removed password callback class from WSS4J in interceptor ...


Colm O hEigeartaigh wrote:
> 
> 
> Yup Dan's right I think. I tested both of the keystores and it works
> fine:
> 
> Crypto crypto = CryptoFactory.getInstance("lukasz.properties");
> WSSecSignature builder = new WSSecSignature();
> builder.setUserInfo("JJ", "JJ-Password");
> Document doc = unsignedEnvelope.getAsDocument();
> WSSecHeader secHeader = new WSSecHeader();
> secHeader.insertSecurityHeader(doc);
> Document signedDoc = builder.build(doc, crypto, secHeader);
> 
> ...
> 
> Crypto cryptoPub = CryptoFactory.getInstance("lukasz_pub.properties");
> secEngine.processSecurityHeader(doc, null, this, cryptoPub);
> 
> Where "this" is a CallbackHandler implementation where we set:
> 
> pc.setPassword("JJ-Password");
> 
> Are you sure that you were doing this last step?
> 
> Colm.
> 
> 

-- 
View this message in context:
http://www.nabble.com/Exception%3A-DerInputStream.getLength%28%29%3A-len
gthTag%3D119%2C-too-big-tp21711285p21745484.html
Sent from the WSS4J mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to