We have required to sign and encrypt request payloads. We already have accomplished for the signed payload. Now we need to encrypt that signed payload using the receiver systems public CA certificate.
Please help how can this steps be achieve in Java. What are libraries, packages and apis etc might be required? It would help to have sample code for reference.
Below is the sample of a encrypted payload. I have trimmed the namespaces in the sample to avoid issues posting here in SO.
Any inputs is highly appreciated.
<xenc:EncryptedData xmlns:xenc="xmlenc#" Type="xmlenc#Element">
<xenc:EncryptionMethod Algorithm="xmlenc#tripledes-cbc"/>
<ds:KeyInfo xmlns:ds="xmldsig#">
<xenc:EncryptedKey>
<xenc:EncryptionMethod Algorithm="xmlenc#rsa-1_5"/>
<xenc:CipherData>
<xenc:CipherValue>b44GKIzOikb.....</xenc:CipherValue>
</xenc:CipherData>
</xenc:EncryptedKey>
</ds:KeyInfo>
<xenc:CipherData>
<xenc:CipherValue>CO+A40a3vGzo47S1vaM.....</xenc:CipherValue>
</xenc:CipherData>
</xenc:EncryptedData>