Re: rampart decryption issue

2008-03-06 Thread Ruchith Fernando
Please specify "signaturePropFile" element in your "inflowSecurity" parameter :



  
Timestamp Encrypt
test.PasswordHandler
client.properties
..
  


Thanks,
Ruchith

On Wed, Feb 20, 2008 at 5:42 PM, Paul Ryan <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I'm attempting to call a secure web service hosted within Oracles OWSM using
> an Axis2 client.
>
> The client is using rampart 1.3 and wss4j 1.5.3 to handle the singing and
> encrypting of the SOAP message.
>
>  Signing and encrypting the SOAP request works fine, the message is
> successfully verified and decrypted on the Oracle side but the Axis2 client
> seems to be having a problem decrypting the response message. I get an np
> exception as follows
>
> org.apache.axis2.AxisFault
> at
> org.apache.rampart.handler.WSDoAllReceiver.processMessage(WSDoAllReceiver.java:92)
> at
> org.apache.rampart.handler.WSDoAllHandler.invoke(WSDoAllHandler.java:72)
> at org.apache.axis2.engine.Phase.invoke(Phase.java:292)
>  at org.apache.axis2.engine.AxisEngine.invoke(AxisEngine.java:212)
> at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:132)
> at
> org.apache.axis2.description.OutInAxisOperationClient.handleResponse(OutInAxisOperation.java:336)
>  at
> org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:389)
> at
> org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:211)
> at
> org.apache.axis2.client.OperationClient.execute(OperationClient.java:163)
>  at test.VehicleStub.getVehicle(VehicleStub.java:142)
> at test.VehicleTest.testgetVehicle(VehicleTest.java:35)
> Caused by: java.lang.NullPointerException
> at
> org.apache.ws.security.message.token.X509Security.getX509Certificate(X509Security.java:87)
>  at
> org.apache.ws.security.processor.BinarySecurityTokenProcessor.getCertificatesTokenReference(BinarySecurityTokenProcessor.java:92)
> at
> org.apache.ws.security.processor.BinarySecurityTokenProcessor.handleToken(BinarySecurityTokenProcessor.java:74)
>  at
> org.apache.ws.security.WSSecurityEngine.processSecurityHeader(WSSecurityEngine.java:284)
> at
> org.apache.ws.security.WSSecurityEngine.processSecurityHeader(WSSecurityEngine.java:206)
> at
> org.apache.rampart.handler.WSDoAllReceiver.processBasic(WSDoAllReceiver.java:213)
>  at
> org.apache.rampart.handler.WSDoAllReceiver.processMessage(WSDoAllReceiver.java:86)
> ... 25 more
>
>
> I've debugged the code and have followed the processing from the rampart
> WSDoAllReceiver  wss4j WSSecurityEngine  wss4j
> BinarySecurityTokenProcessor
>
> In the BinarySecurityTokenProcessor I can see that the crypto variable is
> null and the decCrypto variable is set but in the following code only the
> crypto variable is passed to the
> getCertificatesTokenReference() method causing the npe.
>
> public void handleToken(Element elem, Crypto crypto, Crypto decCrypto,
> CallbackHandler cb, WSDocInfo wsDocInfo, Vector returnResults,
> WSSConfig config) throws WSSecurityException {
>  this.getCertificatesTokenReference(elem, crypto);
> returnResults.add(0, new WSSecurityEngineResult(WSConstants.BST,
> this.token, this.certificates));
> }
>
> private void getCertificatesTokenReference(Element elem, Crypto crypto)
>  throws WSSecurityException {
> this.createSecurityToken(elem);
> if (token instanceof PKIPathSecurity) {
> this.certificates = ((PKIPathSecurity)
> token).getX509Certificates(false, crypto);
>  } else if (token instanceof X509Security) {
> NPE X509Certificate cert = ((X509Security)
> token).getX509Certificate(crypto);
> this.certificates = new X509Certificate[1];
> this.certificates[0] = cert;
>  }
> }
>
> My rampart client configuration section is as follows
>
> 
>   
> Timestamp Signature Encrypt
>  paul1
> client.properties
> test.PasswordHandler
> DirectReference
>  paul1
> client.properties
> DirectReference
>
> 
>
> 
>   
> Timestamp Encrypt
> test.PasswordHandler
>  client.properties
>   
> 
>
>
> I probably have a mis-configuration problem, any help would be welcome.
>
> Regards,
>  Paul.
>



-- 
http://blog.ruchith.org
http://wso2.org


rampart decryption issue

2008-02-20 Thread Paul Ryan
Hi,

I'm attempting to call a secure web service hosted within Oracles OWSM using
an Axis2 client.

The client is using rampart 1.3 and wss4j 1.5.3 to handle the singing and
encrypting of the SOAP message.

Signing and encrypting the SOAP request works fine, the message is
successfully verified and decrypted on the Oracle side but the Axis2 client
seems to be having a problem decrypting the response message. I get an np
exception as follows

org.apache.axis2.AxisFault
at org.apache.rampart.handler.WSDoAllReceiver.processMessage(
WSDoAllReceiver.java:92)
at org.apache.rampart.handler.WSDoAllHandler.invoke(WSDoAllHandler.java
:72)
at org.apache.axis2.engine.Phase.invoke(Phase.java:292)
at org.apache.axis2.engine.AxisEngine.invoke(AxisEngine.java:212)
at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:132)
at org.apache.axis2.description.OutInAxisOperationClient.handleResponse(
OutInAxisOperation.java:336)
at org.apache.axis2.description.OutInAxisOperationClient.send(
OutInAxisOperation.java:389)
at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(
OutInAxisOperation.java:211)
at org.apache.axis2.client.OperationClient.execute(OperationClient.java
:163)
at test.VehicleStub.getVehicle(VehicleStub.java:142)
at test.VehicleTest.testgetVehicle(VehicleTest.java:35)
Caused by: java.lang.NullPointerException
at org.apache.ws.security.message.token.X509Security.getX509Certificate(
X509Security.java:87)
at
org.apache.ws.security.processor.BinarySecurityTokenProcessor.getCertificatesTokenReference
(BinarySecurityTokenProcessor.java:92)
at
org.apache.ws.security.processor.BinarySecurityTokenProcessor.handleToken(
BinarySecurityTokenProcessor.java:74)
at org.apache.ws.security.WSSecurityEngine.processSecurityHeader(
WSSecurityEngine.java:284)
at org.apache.ws.security.WSSecurityEngine.processSecurityHeader(
WSSecurityEngine.java:206)
at org.apache.rampart.handler.WSDoAllReceiver.processBasic(
WSDoAllReceiver.java:213)
at org.apache.rampart.handler.WSDoAllReceiver.processMessage(
WSDoAllReceiver.java:86)
... 25 more


I've debugged the code and have followed the processing from the rampart
WSDoAllReceiver  wss4j WSSecurityEngine  wss4j
BinarySecurityTokenProcessor

In the BinarySecurityTokenProcessor I can see that the crypto variable is
null and the decCrypto variable is set but in the following code only the
crypto variable is passed to the
getCertificatesTokenReference() method causing the npe.

public void handleToken(Element elem, Crypto crypto, Crypto decCrypto,
CallbackHandler cb, WSDocInfo wsDocInfo, Vector returnResults,
WSSConfig config) throws WSSecurityException {
this.getCertificatesTokenReference(elem, crypto);
returnResults.add(0, new WSSecurityEngineResult(WSConstants.BST,
this.token, this.certificates));
}

private void getCertificatesTokenReference(Element elem, Crypto crypto)
throws WSSecurityException {
this.createSecurityToken(elem);
if (token instanceof PKIPathSecurity) {
this.certificates = ((PKIPathSecurity)
token).getX509Certificates(false, crypto);
} else if (token instanceof X509Security) {
NPE X509Certificate cert = ((X509Security)
token).getX509Certificate(crypto);
this.certificates = new X509Certificate[1];
this.certificates[0] = cert;
}
}

My rampart client configuration section is as follows


  
Timestamp Signature Encrypt
paul1
client.properties
test.PasswordHandler
DirectReference
paul1
client.properties
DirectReference
  



  
Timestamp Encrypt
test.PasswordHandler
client.properties
  



I probably have a mis-configuration problem, any help would be welcome.

Regards,
Paul.