c# - Is it possible to create a signed email with an opaque signature using MimeKit? -


basically questions states.

i have written program sign email using x509certificate2 installed on users machine. done mimekit, makes easy (as shown).

var signer = new cmssigner(certificate, key); signer.digestalgorithm = digestalgorithm.sha1;  message.body = multipartsigned.create(ctx, signer, messagecontent); 

i've been asked if possible create signed email using 'opaque' signature instead of detached signature. believe there option in openssl can this(??).

anyway, i've been unable find mention of 'opaque' option in relation mimekit.

is possible, , if so, how?

yes, possible. regards s/mime, when people refer opaque signature, mean want signature in application/pkcs7-mime format. here's how go creating that:

var signer = new cmssigner(certificate, key); signer.digestalgorithm = digestalgorithm.sha1;  message.body = applicationpkcs7mime.sign(ctx, signer, messagecontent); 

hope helps!

note:

in late 2013, microsoft announced retiring use of sha-1 in products 2016 assumption days unbroken digest algorithm numbered. speculated sha-1 digest algorithm vulnerable collisions, , no longer considered secure, 2018.

microsoft , other vendors plan move sha-2 suite of digest algorithms includes following 4 variants: sha-224, sha-256, sha-384, , sha-512.


Comments

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

php - CakePHP HttpSockets send array of paramms -

node.js - Using Node without global install -