smime

OpenSSL treats smime message with Content-type 'Application/EDI' as text and changes line breaks

空扰寡人 提交于 2019-12-08 13:25:35
问题 I receive smime message with content-type 'Application/EDI'. It is non-standard mime type and content should be interpreted as binary. But OpenSSL during verifying signature treats it as text and changes line breaks from '\n' to '\r\n' (as needed by spec for content-type 'text'). So digest becomes wrong and verification fails. Is there any way to make openssl not chaging anything in original message? Argument '-binary' doesn't work on any version (I tried 0.9.7, 0.9.8, 1.0.0). 回答1: Ok,

Why doesn't my key identifier match?

泪湿孤枕 提交于 2019-12-07 01:42:26
问题 I'm attempting to decrypt an S/MIME email (sent originally via Outlook), and to do that, I'm using the bouncycastle API. I'm running into a snag, though. I have, in the Windows certificate store, the certificate for the recipient. I had previously used it to send a signed and encrypted email to the other party, and they in turn used it to send me an encrypted reply. I then exported the certificate (with private key) as a .pfx file, and I loaded this pfx file into a Java KeyStore. It doesn't

Sending an e-mail with an attachment using S/MIME (PHP)

倖福魔咒の 提交于 2019-12-06 06:10:00
问题 I'm trying to send an encrypted email with an attachment from PHP, however, my e-mail is just diplayed as plain text in the email-client (in this case MS Outlook). This is the code I use to send the email: $semi_rand = md5(time()); $mime_boundary = "==Multipart_Boundary_x{$semi_rand}x"; $fileatt = "\path\to\attachment"; $headers = array(); $headers['From'] = $email_from; $headers['Subject'] = $email_subject; $headers['MIME-Version'] = "1.0"; $headers['Content-Type'] = "multipart/mixed;

openssl smime in ruby/rails

送分小仙女□ 提交于 2019-12-04 17:18:58
So, i have this application that creates a zip file with images and stuff and i want to sign it using smime . if i use the terminal command: openssl smime -binary -sign -passin "pass:MYPASS" -signer ./MyCertificate.pem -inkey ./MyKey.pem -in ./manifest.in -out ./signature.out -outform DER Formated: openssl smime -binary -sign -passin "pass:MYPASS" \ -signer ./MyCertificate.pem -inkey ./MyKey.pem \ -in ./manifest.in -out ./signature.out -outform DER the manifest.in is the file witch contains the text to be signed and signature.out is the output file. i don't know a lot about signing but i

Cannot generate Apple Passbook signature

空扰寡人 提交于 2019-12-03 08:20:18
I am writing a shell script to automatically generate an Apple Passbook signature file from manifest.json using p12 certificate. Here is what I do: openssl pkcs12 -passin pass:"mypass" -in "mycert.p12" -clcerts -nokeys -out certificate.pem openssl pkcs12 -passin pass:"mypass" -in "mycert.p12" -nocerts -out key.pem openssl smime -passin pass:"mypass" -binary -sign -signer certificate.pem -inkey key.pem -in manifest.json -out signature -outform DER The first two functions work fine. At least both certificate.pem and key.pem are created. The signature file is also created, but for some reason it

Different S/MIME signature between OpenSSL and C#

元气小坏坏 提交于 2019-11-28 14:03:27
I'm trying to use an OpenSSL code in my .Net program. Here's the code: openssl pkcs12 -in "My PassKit Cert.p12" -clcerts -nokeys -out certificate.pem openssl pkcs12 -in "My PassKit Cert.p12" -nocerts -out key.pem smime -binary -sign -signer certificate.pem -inkey key.pem -in manifest.json -out signature -outform DER I tried to use .Net OpenSSL, but I absolutely have no idea how to use it, and I couldn't find a good documentation for it. I decided to use .Net to perform the same sign process, here's the code: var dataToSign = System.IO.File.ReadAllBytes(filePathToSign); ContentInfo contentInfo

EWS: Retrieving attachments from signed emails

徘徊边缘 提交于 2019-11-27 07:04:23
问题 I have a C# program that manages a resource mailbox by retrieving attachments and categorizing emails into sub-folders. An issue came up recently where the client wishes to send us signed emails, so when the program retrieves their attachments a file named "smime.p7m" is saved instead of the file attachments. This file is not present when reviewing the email in Outlook, only the attachments we want. However, when stepping through the code, the attachments listed in the Email object only

How to get PKCS7_sign result into a char * or std::string

时间秒杀一切 提交于 2019-11-26 06:03:46
问题 I try to write a little mail milter to sign mails with S/MIME. So far, I have completed to the code up to signing the mail. I used the demos/smime code examples in openssl to do the job. Unfortunately the examples demonstrate how to write a input message to an output file, but I need the result as a string. This is my Smime-method: void Smime::sign() { if (!isLoaded()) return; // Null-mailer or unknown if (mailFrom.empty()) return; auto *client = util::mlfipriv(ctx); bool signedOrEncrypted =