on 2023 Mar 16 9:11 AM
Hi,
I have the scenario that I need to Sign the complete XML message using PKCS7 Standard algorithm with attachment mode and the signed content should be converted to base 64.
I tried using the scenario in the iflow in CPI, but i did not get the correct ouput. Kindly help me with the scenario.


Regards,
Nisha.
Request clarification before answering.
Hi Carlos,
Thank you for your information. But this blog says the input is encrypted and they are going to decrypt. But I am getting the input as XML and I need to sgin the whole xml messages.Kindly help me with that.
Regards,
Nisha.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Nisha,
If I understand correctly:
- you have a message with xml content
- you want to create a digital signature and place it into the xml content
Right?
As far as I know, this is not compliant with the PKCS#7 or CMS standard, where the content and the security artifacts are stored in a CMS-structure.
Which would mean that the PKCS#7/CMS Signer in CPI cannot help you here.
You would need to implement it yourself in a groovy script.
There was a similar requirement in the past and Sunny created a blog post:
https://blogs.sap.com/2018/12/24/how-to-encryptdecrypt-xml-payload-with-aes256-cbc-and-rsa-algorithm...
Does that help?
Kind Regards,
Carlos
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Nisha,
Hope you are doing well..!
I Have similar requirement where i need to sign the <Body> node and its child using key store certificate, convert to base64 and then place it under singautreValue tag like below before GZip.
could share me how you achieve your requirement so that i can simulate it with mine
<?xml version="1.0" encoding="UTF-8"?>
<Message>
<Header>
<Sender>TEST</Sender>
<Receiver>TEST</Receiver>
<MessageType>TEST</MessageType>
<MessageDescription>TEST</MessageDescription>
<TimeStamp>2024-11-19T11:27:31</TimeStamp>
</Header>
<Body>
<PayrollMessage>
<PayrollMessageRef>TEST</PayrollMessageRef>
<PayrollMessageType>TEST</PayrollMessageType>
<PayrollTransactionCount>1</PayrollTransactionCount>
<PayrollTransctionAmount>00000.00</PayrollTransctionAmount>
<PayrollTransaction>
<SequenceNum>00000</SequenceNum>
<TransactionData>:20:43733
:32A:241119XXX0000
:50:TEST
:52A:TEST
:53B:/0000000000
:57A:TEST
:59:/00000000000000000000
TEST
CITY
:70:TEST
:72:000000
00000,00
0000,00
00000,00
0,00</TransactionData>
</PayrollTransaction>
</PayrollMessage>
</Body>
<Signature>
<SignatureValue>MIAGCSqGSIb3DQEHAqCAMIACAQExDzANBglghkgBZQMEAgEFADCABgkqhkiG9w0B==</SignatureValue>
</Signature>
</Message>
Hello Nisha,
thank you for the description of a scenario that might become interesting.
From what I see in the screenshots, you're referring with "attachment mode" to the normal signedData structure where the content is present (not the "external Signature" case, where the content is sent elsewhere)
As such, the signer creates a digital signature and packs it together with the plaintext content into a cms structure with binary data. This can be encoded to base64.
For me that looks correct, wrt spec: https://www.rfc-editor.org/rfc/rfc5652
Could you please kindly clarify, what would be the expected correct output?
Kind Regards,
Carlos
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Nisha,
thank you for the description of a scenario that might become interesting.
From what I see in the screenshots, you're referring with "attachment mode" to the normal signedData structure where the content is present (not the "external Signature" case, where the content is sent elsewhere)
As such, the signer creates a digital signature and packs it together with the plaintext content into a cms structure with binary data. This can be encoded to base64.
For me that looks correct, wrt spec: https://www.rfc-editor.org/rfc/rfc5652
Could you please kindly clarify, what would be the expected correct output?
Kind Regards,
Carlos
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 18 | |
| 6 | |
| 6 | |
| 6 | |
| 6 | |
| 4 | |
| 3 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.