smime

How to sign and encrypt a message using S/MIME in PowerShell

点点圈 提交于 2021-02-07 10:12:35
问题 I am attempting to create a PowerShell script that will: Build a message Sign the message using my private S/MIME certificate Encrypt the message using the S/MIME public cert of the recipient Send the email that has been signed and encrypted I have included the full script below but changed email addresses, cert names, etc. The private cert has been imported onto the machine using Internet Explorer. It is then referenced within the directory C:\Users\xxx\AppData\Roaming\Microsoft

How to sign and encrypt a message using S/MIME in PowerShell

依然范特西╮ 提交于 2021-02-07 10:06:03
问题 I am attempting to create a PowerShell script that will: Build a message Sign the message using my private S/MIME certificate Encrypt the message using the S/MIME public cert of the recipient Send the email that has been signed and encrypted I have included the full script below but changed email addresses, cert names, etc. The private cert has been imported onto the machine using Internet Explorer. It is then referenced within the directory C:\Users\xxx\AppData\Roaming\Microsoft

Email Security: TLS and S/MIME

纵饮孤独 提交于 2021-02-06 13:53:49
问题 My understanding is that TLS is an encryption technique that allowing two STMP servers to communicate with each other securely. If HTTPS is used to connect to an STMP serve is that the same as using S/MIME? 回答1: No. TLS encrypts the communication channel. S/MIME encrypts the message. I.e., it's the difference between "talking openly on a secure line" and "talking in code on an insecure line." 回答2: HTTPS is used to connect to an STMP There seems to be a misunderstanding regarding what HTTPS

Encrypting Headers S/MIME message/rfc822

╄→гoц情女王★ 提交于 2021-01-27 06:09:52
问题 I am looking to encrypt certain mail headers ( Subject and Reply-To ) which are being sent in an encrypted mail. I am taking an entire MIME (Headers included) and successfully encrypting it. I can send this S/MIME encrypted mail to my mail client (Thunderbird) successfully. It will be successfully decrypted and verified as signed. However, any headers that are sent in the inner encrypted MIME are not being used by my mail client. According to RFC-5751 I should be wrapping my mail in a message

Decrypttion fails on S/MIME enveloped message with OAEP key encryption?

*爱你&永不变心* 提交于 2020-01-13 19:13:10
问题 With Java and BouncyCastle I am able to decrypt lots of S/MIME enveloped messages. But when the key encryption algorithm is 1.2.840.113549.1.1.7 (id-RSAES-OAEP), the decryption fails (stack trace at the end of this question). The line where it happens: content = messageRecipientInfo.getContent(new JceKeyTransEnvelopedRecipient(pc).setProvider("BC")); Formerly I used that line to decrypt: content = messageRecipientInfo.getContent(givenCertRecipient); It's all the same. Any guess? EDIT * I now

Decode/extract smime.p7m file contents (email with embedded files) with OpenSSL?

巧了我就是萌 提交于 2020-01-13 04:46:08
问题 We have an old process (VBScript) that reads a common mailbox and processes certain emails into a database. New regulations have all messages with attachments now being digitally signed. The process now only extracts one file (smime.p7m). Using a GUI-based viewer, I can see the embedded files and extract them with no problem. However, what I really need is a command-line based extracter that will write out the embedded files (PDFs, DOCs, XLSs) - they're not encrypted, just signed. I tested

Sending Encrypted Email S/MIME with PHP

久未见 提交于 2020-01-07 04:49:09
问题 I have been looking a lot online but I didn't find an answer, is it possible to send encrypted emails S/MIME using PHP? if it is, how? (im using cakephp 2.x) Thank you very much in advance 回答1: I managed to find a solution to this using PHPMailer, It applies to regular PHP as well. It will sign and encrypt the email, I couldn't find a way to do both with PHPMailer (sign and encrypt) only sign so I added some code to class.phpmailer.php. It stills need to add some error handling in case of an

Unable to decrypt p7m using MimeKit

♀尐吖头ヾ 提交于 2020-01-05 07:38:27
问题 I have located my smime.p7m from my email message, I read it as stream and try to decrypt it using MimeKit, but it failed with Operation is not valid due to the current state of the object. using (MemoryStream ms = new MemoryStream(data)) { CryptographyContext.Register(typeof(WindowsSecureMimeContext)); ApplicationPkcs7Mime p7m = new ApplicationPkcs7Mime(SecureMimeType.EnvelopedData, ms); var ctx = new WindowsSecureMimeContext(StoreLocation.CurrentUser); p7m.Verify(ctx, out MimeEntity output)

Cannot generate Apple Passbook signature

烈酒焚心 提交于 2020-01-01 03:37: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

Python using M2Crypto signing a message with S/MIME

南楼画角 提交于 2019-12-24 07:47:45
问题 I spent hours now and I can not find my error. I want a simple routine that creates a S/MIME signed message that could be used with smtplib later. This is, what I have so far: #!/usr/bin/python2.7 # -*- coding: utf-8 -*- from __future__ import print_function from __future__ import absolute_import import sys from M2Crypto import BIO, Rand, SMIME text = """Das ist ein einfacher Satz""" sign_cert = "cert.pem" sign_key = "key.pem" # ----------------------------------------------------------------