Skip to content

Instantly share code, notes, and snippets.

@filipnavara
Created September 11, 2018 08:02
Show Gist options
  • Save filipnavara/6ac04403ae4a2ab687d6440ca4388919 to your computer and use it in GitHub Desktop.
Save filipnavara/6ac04403ae4a2ab687d6440ca4388919 to your computer and use it in GitHub Desktop.
cms nosig
ContentInfo ci = new ContentInfo(new byte[1]);
SignedCms cms = new SignedCms(ci);
var cert = new System.Security.Cryptography.X509Certificates.X509Certificate2(@"C:\Users\Filip Navara\Documents\Certs\ica2.crt");
CmsSigner signer = new CmsSigner(SubjectIdentifierType.NoSignature, cert);
signer.DigestAlgorithm = new Oid("2.16.840.1.101.3.4.2.1"); // SHA256
cms.ComputeSignature(signer);
MIGbBgkqhkiG9w0BBwKggY0wgYoCAQExDzANBglghkgBZQMEAgEFADAQBgkqhkiG9w0BBwGgAwQBADFiMGACAQEwHDAXMRUwEwYDVQQDEwxEdW1teSBTaWduZXICAQAwDQYJYIZIAWUDBAIBBQAwDAYIKwYBBQUHBgIFAAQgbjQLnP+zepicpUTmu3gKLHiQHT+zNzh2hRGjBhevoB0=
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment