Click here to Skip to main content
15,891,473 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I want to sign a file using RSA algorithm and verify the signature
Below are the scenarios:

1. Outward files will be put in a folder
3. We need to sign the file with a digital signature (using RSA 256) and send to Central Bank.
4. We need to download the response and verify the signature and then copy the file to a folder.
5. If the signature validation fails, a response needs to be send to Central Bank
The file to sign:
<?xml version="1.0" encoding="UTF-8"?>
< psys:request xmlns:psys="urn:iso:std:psys:request" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <id>BNZW0M00000DW</id>
  <type>CR</type>
  <format>MT</format>
  <date>2017-04-26T12:21:13</date>
  <signature></signature>
  <content><![CDATA[{1:F01BNZWOMRXA0011111000000}{2:I102ACHMOMRXA001N}{3:{:113:0100}}{4:
:20:BNZW0M00000DW
:23:CREDIT
:26T:19
:21:BNZW0M00000DW001
:32B:OMR111,
:50K:/123124124
test
:52A:BNZWOMRXA001
:57A:BDOFOMRUA001
:59:/1231234124
test2
:70:
:77B:234234
1
1
:71A:SHA
:32A:170426OMR111,
-}]]></content>
< /psys:request>

After Sign as below:
<?xml version="1.0" encoding="UTF-8"?>
< psys:request xmlns:psys="urn:iso:std:psys:request" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <id>BNZW0M00000DW</id>
  <type>CR</type>
  <format>MT</format>
  <date>2017-04-26T12:21:13</date>
  <signature>UjPx6Z1e7HLZWnhz1uz1LjQFnin/PMjkWDjADrDDOy0AOQdVbp5PwjoJQLzZzZmP5XCmoXKtByRqAzra57LzKdlQF7t4dXD6eG//rfnMvoRY4yOO/R3kuZLdMZ/bmy+nlhtZzRXtmGMoQTvTryC95berRm8liCs1hoiEZZ20ykAXXR45RaZuffWjTajF20/n8GJkSU9JSdtySr6rAOlV5Wi2hVD4v4Iqszka360w60NF4sNvpcwXt5EX1yx+o2GibDcBRDkW1Oo8r0IPCnuOQU/HWSks5K8aiTsAvqEP7SyKFbwLxSv3cQSWFbiWNQOX/Ejs3PPMBhRNxa3TA1tuVA==</signature>
  <content><![CDATA[{1:F01BNZWOMRXA0011111000000}{2:I102ACHMOMRXA001N}{3:{:113:0100}}{4:
:20:BNZW0M00000DW
:23:CREDIT
:26T:19
:21:BNZW0M00000DW001
:32B:OMR111,
:50K:/123124124
test
:52A:BNZWOMRXA001
:57A:BDOFOMRUA001
:59:/1231234124
test2
:70:
:77B:234234
1
1
:71A:SHA
:32A:170426OMR111,
-}]]></content>
< /psys:request>


What I have tried:

I want to sign a file using RSA algorithm and verify the signature. Tried a simple file but didn't work.
Posted
Updated 27-Apr-17 0:39am

1 solution

Not a code only solution, but you could try the Windows Signtool.exe.
Here is an article about it where RSA is also mentioned: [5 Code Sign Examples]
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900