Ask a Question

Problem axis2 rampart decrypt message

Saruman
Visitor

Problem axis2 rampart decrypt message

Hi,

Service is implemented with axis2 rampart to encrypt/decrypt message.

Request is sent and operative works correctly, but when it comes to decrypt message in SOAPUi, returns the following error:

ERROR:org.apache.ws.security.WSSecurityException: The signature or decryption was invalid
...............
org.apache.ws.security.WSSecurityException: General security error (The private key for the supplied does not exist in the keystore alias)

When the Operation run in JAVA, the message is decrypted correctly.

Please, can you help me?

 

File configuration.docx has configuration soap encrypt/decrypt.


Best regards.

 

WspPoliciy file:

 

<wsp:Policy wsu:Id="XXXXXXXXXXX"
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata"
xmlns:wsap="http://schemas.xmlsoap.org/ws/2004/08/addressing/policy"
xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy">
<wsp:ExactlyOne>
<wsp:All>
<wsap:UsingAddressing />
<sp:AsymmetricBinding xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
<wsp:Policy>
<sp:InitiatorToken>
<wsp:Policy>
<sp:X509Token sp:IncludeToken="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/IncludeToken/AlwaysToRecipient">
<wsp:Policy>
<sp:RequireThumbprintReference/>
<sp:WssX509V3Token10/>
</wsp:Policy>
</sp:X509Token>
</wsp:Policy>
</sp:InitiatorToken>
<sp:RecipientToken>
<wsp:Policy>
<sp:X509Token sp:IncludeToken="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/IncludeToken/Never">
<wsp:Policy>
<sp:RequireThumbprintReference/>
<sp:WssX509V3Token10/>
</wsp:Policy>
</sp:X509Token>
</wsp:Policy>
</sp:RecipientToken>
<sp:AlgorithmSuite>
<wsp:Policy>
<sp:TripleDesRsa15/>
</wsp:Policy>
</sp:AlgorithmSuite>
<sp:Layout>
<wsp:Policy>
<sp:Strict/>
</wsp:Policy>
</sp:Layout>
<sp:IncludeTimestamp/>
<sp:OnlySignEntireHeadersAndBody/>
</wsp:Policy>
</sp:AsymmetricBinding>

<sp:Wss10 xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
<wsp:Policy>
<sp:MustSupportRefKeyIdentifier />
<sp:MustSupportRefIssuerSerial />
</wsp:Policy>
</sp:Wss10>

<sp:SignedParts xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
<sp:Body/>
</sp:SignedParts>

<sp:EncryptedParts xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
<sp:Body/>
</sp:EncryptedParts>

<ramp:RampartConfig xmlns:ramp="http://ws.apache.org/rampart/policy">
<ramp:user>XXXXXXX</ramp:user>
<ramp:encryptionUser>XXXXXXX</ramp:encryptionUser>
<ramp:passwordCallbackClass>XXXXXXXXX</ramp:passwordCallbackClass>
<ramp:ReplayDetection>10</ramp:ReplayDetection>

<ramp:signatureCrypto>
<ramp:crypto provider="org.apache.ws.security.components.crypto.Merlin">
<ramp:property
name="org.apache.ws.security.crypto.merlin.keystore.type">JKS</ramp:property>
<ramp:property name="org.apache.ws.security.crypto.merlin.file">XXXXXXXX</ramp:property>
<ramp:property
name="org.apache.ws.security.crypto.merlin.keystore.password">XXXXXXXXX</ramp:property>
</ramp:crypto>
</ramp:signatureCrypto>

<ramp:encryptionCypto>
<ramp:crypto provider="org.apache.ws.security.components.crypto.Merlin">
<ramp:property
name="org.apache.ws.security.crypto.merlin.keystore.type">JKS</ramp:property>
<ramp:property name="org.apache.ws.security.crypto.merlin.file">XXXXXXX</ramp:property>
<ramp:property
name="org.apache.ws.security.crypto.merlin.keystore.password">XXXXXXXXX</ramp:property>
</ramp:crypto>
</ramp:encryptionCypto>

</ramp:RampartConfig>

</wsp:All>

</wsp:ExactlyOne>
</wsp:Policy>


Response:

 

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Header xmlns:wsa="http://www.w3.org/2005/08/addressing">
<wsse:Security soapenv:mustUnderstand="1" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
<wsu:Timestamp wsu:Id="TS-150">
<wsu:Created>2015-07-30T09:09:05.800Z</wsu:Created>
<wsu:Expires>2015-07-30T09:14:05.800Z</wsu:Expires>
</wsu:Timestamp>
<xenc:EncryptedKey Id="EK-BB4A3834139B69E49114382473458364" xmlns:xenc="http://www.w3.org/2001/04/xmlenc#">
<xenc:EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#rsa-1_5"/>
<ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
<wsse:SecurityTokenReference>
<wsse:KeyIdentifier EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary" ValueType="http://docs.oasis-open.org/wss/oasis-wss-soap-message-security-1.1#ThumbprintSHA1">mcTxCcDoNjcop3WA1...
</wsse:SecurityTokenReference>
</ds:KeyInfo>
<xenc:CipherData>
<xenc:CipherValue>eCIbbUmpr3NwFrR6bPRXUbPW/4plqChy8GSzDMK7fEKC9ja+p+xMBcq2BRXVL5hMJedvJQyAfGLFcSRUPAMNVNW4LU6aWRGilEj1/MFb2WZ9zI9TYYcZh92SM4alX+8f1sxYjR47rKjN7xT8mBhSQDVy/pK/MFv9Q5eNsTROVkLu0MHdHRMjMxOpAcjIOViHyRrRiQcpRioN+rgHG8fB7icSWXOVAcfsOgbPNXbyq2q7Q1QCH8WDUk24YTnpIAeVycSeEw22ec6NzAoZyEdB++i1DTTqdXzQ+ii+Da7jWnA6oIdH6NqcVYFs/yrk+cBoZjANJE4LmbsqrVa6tBH2hw==</xenc:CipherValue>
</xenc:CipherData>
<xenc:ReferenceList>
<xenc:DataReference URI="#ED-152"/>
</xenc:ReferenceList>
</xenc:EncryptedKey>
<ds:Signature Id="SIG-151" xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
<ds:SignedInfo>
<ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#">
<ec:InclusiveNamespaces PrefixList="wsa soapenv" xmlns:ec="http://www.w3.org/2001/10/xml-exc-c14n#"/>
</ds:CanonicalizationMethod>
<ds:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/>
<ds:Reference URI="#Id-1812818957">
<ds:Transforms>
<ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#">
<ec:InclusiveNamespaces PrefixList="" xmlns:ec="http://www.w3.org/2001/10/xml-exc-c14n#"/>
</ds:Transform>
</ds:Transforms>
<ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
<ds:DigestValue>SqybhI+v6zq8GSgHxj5c1Bej8NQ=</ds:DigestValue>
</ds:Reference>
<ds:Reference URI="#TS-150">
<ds:Transforms>
<ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#">
<ec:InclusiveNamespaces PrefixList="wsse wsa soapenv" xmlns:ec="http://www.w3.org/2001/10/xml-exc-c14n#"/>
</ds:Transform>
</ds:Transforms>
<ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
<ds:DigestValue>+zfSzCe3DP9LvwDUNNeM/zgCgBo=</ds:DigestValue>
</ds:Reference>
</ds:SignedInfo>
<ds:SignatureValue>Nfm/w329tyS7Xu4Hs9iP0Rjr5yHEnVa0E4gnT1119ao/EOXKXeYcMcTlJDSamsdOKwZAIpA8hklE9aJns0YTzTAl/uik9SOQAOB7E1KMyfWcgO9WHZw54LXpbOnb10qTULE5vKQiJQqd/c+zuOt9O7XG21lJThAXplWvrBzFrWLLWUhipb8DVtL9mU7BSpLA7s0T3aSxQ9EOXM+H9HiJOoJ1KZEwZSq8hpcPiTSHYtw3Kvwbvce3/AYiK1tInyV4crtp39MUuYi+9boq+u1QY9rPhhiW28KmqvN5CnR65vtMOWEPw3lDvtMcpuUWQZR1HhNP/vC567S097K5tvKkTg==</ds:SignatureValue>
<ds:KeyInfo Id="KI-BB4A3834139B69E49114382473458062">
<wsse:SecurityTokenReference wsu:Id="STR-BB4A3834139B69E49114382473458073">
<wsse:KeyIdentifier EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary" ValueType="http://docs.oasis-open.org/wss/oasis-wss-soap-message-security-1.1#ThumbprintSHA1">jsm3tV2KEGeN2uCuu...
</wsse:SecurityTokenReference>
</ds:KeyInfo>
</ds:Signature>
</wsse:Security>
<wsa:Action>XXXXXXXXXXXXXXXXXXXXXXXX</wsa:Action>
<wsa:RelatesTo>uuid:f17f257a-550d-4a3a-85b7-8727e32436bd</wsa:RelatesTo>
</soapenv:Header>
<soapenv:Body wsu:Id="Id-1812818957" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
<xenc:EncryptedData Id="ED-152" Type="http://www.w3.org/2001/04/xmlenc#Content" xmlns:xenc="http://www.w3.org/2001/04/xmlenc#">
<xenc:EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#tripledes-cbc"/>
<ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
<wsse:SecurityTokenReference wsse11:TokenType="http://docs.oasis-open.org/wss/oasis-wss-soap-message-security-1.1#EncryptedKey" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsse11="http://docs.oasis-open.org/wss/oasis-wss-wssecurity-secext-1.1.xsd">
<wsse:Reference URI="#EK-BB4A3834139B69E49114382473458364"/>
</wsse:SecurityTokenReference>
</ds:KeyInfo>
<xenc:CipherData>
<xenc:CipherValue>szz0hvKBjhKj0guTjdI7WgFOfLmaQDIlTvaHKyguZVFaVl+rwdFT/ejI8qp+NQg9jdDP2TVH8aMFpAZW2xkAKVUeClp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LmMRVmF8Cnyq1UizJjc7UK4CSZe3scjQnVyAk3TS/lKNWtnlGRq+PyaMOV8EKZeyFEu2HJzNHlIQ2KFBNBanqrC7Orot67Ywj3J+v50qvJOiDlmaFfDXnIL7za3pom3o1FyMjtgXSnqXyWP+XS8f5sSeJ6t/MNrdHwSgB1YKjAhggp1HJ19Wm/Kr+Q+wzBVdrtacYqdiRkg+NqwCzA2fIvKZtr7hdAGA9f2hM=</xenc:CipherValue>
</xenc:CipherData>
</xenc:EncryptedData>
</soapenv:Body>
</soapenv:Envelope>

 

 

  

cancel
Showing results for 
Search instead for 
Did you mean: