Skip to content

Instantly share code, notes, and snippets.

@jstedfast
Last active December 27, 2018 19:20
Show Gist options
  • Save jstedfast/1f87f0c3aa73cad7ff169c3407f3c634 to your computer and use it in GitHub Desktop.
Save jstedfast/1f87f0c3aa73cad7ff169c3407f3c634 to your computer and use it in GitHub Desktop.
// first we need to base64 decode the content of the existing pkcs7-mime part
var content = new MemoryStream ();
pkcs7.Content.DecodeTo (content);
content.Position = 0;
// now we create a new pkcs7-mime part with the proper smime-type parameter
pkcs7 = new ApplicationPkcs7Mime (SecureMimeType.EnvelopedData, content);
// now decrypt it:
var decrypted = pkcs7.Decrypt (ctx);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment