Hi,
I have to write webservice based on provided WSDL and additional
specification.
Sample request, which I need to process looks like:
<ns0:findMedDocsOfPatientRequestPar
xmlns:ns0="http://www.domain.com/xsd/smth/reg"
xmlns:ns1="http://www.domain.com/xsd/smth/datatypes">
<metadata>
<receiver>15113180204300</receiver>
</metadata>
<EncryptedRequest>
<KeyInfo>X1JRq4ztpkb/G81EpTi1Su3H1K2vOpKvq2aa+8TKCM+i+iYKLF0aRWntaBWIt/vR2XKn1idR+blg
a3IiN6cl10RnD+VTDPDrfz9nvJfejiDHagRrGOczvkKnYDFTSVIiDFIRfmXG6/+7mPeMfOIM18ik
UQyiaF9fXORNt64YrXyJEPAvE79s73UKp4h/7v7S9TaHJNoR1W4NdxrM9t69y810UM4jBGup/p9o
+5ufj1Uv8GTfpahd50wi8nfOCBsUoBKdsqKowCP0UNfdukqQcLtsvL1B6p3sczzAZeG1FycIPdB0
GJn2T3fUpi3Zl2yo/UpMRSFA84zdA66F4uOKCg==</KeyInfo>
<request>
<xenc:EncryptedData xmlns:xenc="http://www.w3.org/2001/04/xmlenc#"
Type="http://www.w3.org/2001/04/xmlenc#Content">
<xenc:EncryptionMethod
Algorithm="http://www.w3.org/2001/04/xmlenc#aes128-cbc"/>
<ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
<xenc:EncryptedKey>
<xenc:EncryptionMethod
Algorithm="http://www.w3.org/2001/04/xmlenc#kw-tripledes"/>
<xenc:CipherData>
<xenc:CipherValue>nKHP7vvFwhl9XpLaZhlZlHMXvhrj1MUcca8AR8WsXlY=</xenc:CipherValue>
</xenc:CipherData>
</xenc:EncryptedKey>
</ds:KeyInfo>
<xenc:CipherData>
<xenc:CipherValue>jAxLLB2ab+UT9A+ClgsWKWR1OZKFMhRDVchSyFa2PEE8jZL0WmQmYi7/3URhiUI5OOJUGjPZKsa+
FFHQnAZ9JOin5nWqMKBz7hjiKiClknAu8f8l44Shy+pdyYSUhOebQUna0FSptwDrdkIvhh/6bvKZ
U5xw2QZRigRTJiAr7pi8q+OsnufMPMIncRh5tfKXIam3kankPNRqIrN7ZU15Cu23FLjOE6miwiKl
8cavQhkCTT+qPmYaCFtVT3e0B/IKdQ2ZpFcWcKubo4TKWck4zDftmXHxy/ZniXUHW4QybvP88bmt
oILFxF/6ZU1c+urH+i9pL/0hb126MLYJR97KOhLQDIU5evfu+IRfSc0Qp5fOd8nigWWltdNW/xbb
C1DjjJyhdrvKoFtQN21xUuQjxbvELVlP/rbkxXyLfEf084zNx6WAlwlGagKv2M8ItV6OVbyJ7MWb
0/eiAePoT5rG9MkB+I8wFaY+3z5NpiRBj8sYlUR1Ody48a3BVleOBeldG+pkPzDd2eRbbOUN6JtP
4Q9w0uHuZVCLPpuvuF764sEKY/zSiLdTCZbYeoiZ4dt4gvhOSQpT3AIHrEU7wynFKx60NSLqUUWM
XUYb/MfpXp/79aTbSIUbGYbIQAAB7CbfCXp8Cm/o4CcGHtVAB8o3jVxOa0ZC6p1j4l8rSR0TtxI=</xenc:CipherValue>
</xenc:CipherData>
</xenc:EncryptedData>
</request>
</EncryptedRequest>
</ns0:findMedDocsOfPatientRequestPar>
And I need to decrypt it to the form:
<ns0:findMedDocsOfPatientRequestPar
xmlns:ns0="http://www.domain.com/xsd/smth/reg"
xmlns:ns1="http://www.domain.com/xsd/smth/datatypes">
<metadata>
<receiver>15113180204300</receiver>
</metadata>
<request>
<asyncInvokeId>3200a3b4-80f6-4099-89fb-00543f3006ba</asyncInvokeId>
<searchCriteria>
<patientName>
<firstName>Slawomir</firstName>
<lastName>Slawomirski</lastName>
</patientName>
<patientIds>
<personIdent>
<nationalPersonId>
<issuingCountry>PL</issuingCountry>
<personIdNumber>63101101023</personIdNumber>
</nationalPersonId>
</personIdent>
</patientIds>
</searchCriteria>
<selectionCriteria>
<docTypeCode>X1.01</docTypeCode>
<docTypeCode>X1.01</docTypeCode>
</selectionCriteria>
</request>
</ns0:findMedDocsOfPatientRequestPar>
**Specification**:
Encrypted is only `<request>` content but it is wrapped by
`<EncryptedRequest>` element too.
`<KeyInfo>` is also in section `<EncryptedRequest>` and it is DES key
encrypted by my public key with algorithm: RSA/ECB/PKCS1PADDING.
Content of `<request>` is encrypted by AES key which is encrypted by DES
key in WRAP mode with algorithm: xmlenc#kw-tripledes
So, my question is:
How to simply receive and process this encrypted request in java?
My software stack is:
- cxf
- spring
- camel
I can configure this without encryption or with simple encryption.
But in this manner seems to difficult for me and I don't want to
reinvent the wheel.
Provided WSDL corresponds to decrypted form but in encrypted form we
have strange `<EncryptedRequest>` section wrapper.
Please help. :)
Ps. Better formatted is here:
http://stackoverflow.com/questions/27104746/webservice-decryption