.net - "An internal certificate chaining error has occurred" error while signing email in C# -


i'm trying digitally sign content, including whole certificate chain in signature (so recipient can verify signature no problems). following error: "an internal certificate chaining error has occurred" when calling computesignature() method.

both root ca , intermediate ca certificates installed in machine. i'm trying sign content verisign email certificate.

intermediate ca certificate is: verisign class 1 individual subscriber ca - g3

root ca certificate is: verisign class 1 public primary certification authority - g3

here's code i'm using:

public static byte[] getsignature(     string message,      x509certificate2 signingcertificate) {     byte[] messagebytes = encoding.ascii.getbytes(message);      signedcms signedcms = new signedcms(new contentinfo(messagebytes), true);      cmssigner cmssigner = new cmssigner(subjectidentifiertype.issuerandserialnumber, signingcertificate);     cmssigner.includeoption = x509includeoption.wholechain;      pkcs9signingtime signingtime = new pkcs9signingtime();     cmssigner.signedattributes.add(signingtime);      signedcms.computesignature(cmssigner, false);       return signedcms.encode(); } 


Comments

Popular posts from this blog

java - SNMP4J General Variable Binding Error -

windows - Python Service Installation - "Could not find PythonClass entry" -

Determine if a XmlNode is empty or null in C#? -