We have two files, one is plain text another is signature file. We have to verify the integrity of the message.
The details of SIG file is as under:
Digital signature in PKCS7 format
Signatures are attached in detach mode
Algorithm : SHA1
Signature rule: End certificate of the User. .
What we are doing is
1. Calculating the hash of plain text file say it is hasPlain
2. Extracting the public key from SIG file
3. Extracting the Encrypted Hash from SIG file
4. Decrypting the above hash by using public key say it will give us hashSign
5. Comparing hashPlain and hasSign, if both are equal then signature is verified
6. We are using RSACryptoservic eprovider class of .net
We are able to extract the public key from SIG file but we are not able to extract Encrypted Hash from SIG File.
Please help
The details of SIG file is as under:
Digital signature in PKCS7 format
Signatures are attached in detach mode
Algorithm : SHA1
Signature rule: End certificate of the User. .
What we are doing is
1. Calculating the hash of plain text file say it is hasPlain
2. Extracting the public key from SIG file
3. Extracting the Encrypted Hash from SIG file
4. Decrypting the above hash by using public key say it will give us hashSign
5. Comparing hashPlain and hasSign, if both are equal then signature is verified
6. We are using RSACryptoservic eprovider class of .net
We are able to extract the public key from SIG file but we are not able to extract Encrypted Hash from SIG File.
Please help
Comment