I am trying to compute a signature this way:
System.Security.Cryptography.Pkcs.ContentInfo contentInfo = new System.Security.Cryptography.Pkcs.ContentInfo(inputBytes);
SignedCms signedCms = new SignedCms(contentInfo);
CmsSigner cmsSigner = new CmsSigner(cert);
cmsSigner.DigestAlgorithm = new Oid("1.3.14.3.2.26");
signedCms.ComputeSignature(cmsSigner, false);
byte[] enc = signedCms.Encode();
This works fine, because the Oid is for SHA1, but if I replace it with OID for SHA256:
2.16.840.1.101.3.4.2.1
it will wail with "Invalid algorithm specified".
Any ideas?
I am using windows xp sp3 .NET 3.5 sp1