Click here to Skip to main content
15,890,690 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi all,

I am trying to sign my data by using cms signer and sha256 digest algo .

code is working fine on my machine .

but on client machine i am getting internal server error

can any one have any idea please share

it is little bit urgent .


thanks

What I have tried:

CmsSigner signer = new CmsSigner(certificate);

signer.DigestAlgorithm = new Oid("SHA256");// ("2.16.840.1.101.3.4.2.1");
signer.SignedAttributes.Add(new Pkcs9SigningTime());
// create the signature
signer.IncludeOption = X509IncludeOption.None;

signedCms.ComputeSignature(signer, false);
Posted
Updated 1-Jun-16 6:40am
Comments
Richard Deeming 1-Jun-16 11:29am    
"Internal server error" is just a message telling you that something went wrong; you'll need to track down the real error to find out what the problem is.

Assuming this is ASP.NET, there should be an entry in the application event log with more details. Alternatively, use Failed Request Tracing[^] to trace the failed request.

1 solution

It's exploding probably because "SHA256" is not proper Oid descriptor.

It should be:
signer.DigestAlgorithm = new Oid("2.16.840.1.101.3.4.2.1");


An "Internal server error" means that you haven't properly setup the objects and/or properties required to use the Signer. There's probably more that's wrong but you're not showing enough code to make that determination.
 
Share this answer
 

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