簡體   English   中英

PHP閱讀S / Mime電子郵件p7m附件(Base64?)

[英]PHP Reading a S/Mime email p7m attachment (Base64?)

我們有一個使用Symantec PGP Universal Web Messenger的系統。

這意味着電子郵件是使用pkcs12證書中的s / mime加密發送給我的。

我在閱讀PHP中的消息時遇到了一些麻煩。

我擁有所有imap代碼,但是現在我如何讀取加密的p7m附件。 它僅僅是Base64編碼和簽名的嗎?

編輯:我有公共密鑰。

這是啞劇信息:-

Content-Type: application/pkcs7-mime; smime-type=enveloped-data;\r\n\tname="Message.p7m"\r\nContent-Transfer-Encoding: BASE64\r\nContent-Disposition: attachment; filename="Message.p7m"

P7M文件類型主要與PKCS #7 MIME Message關聯。 請參閱RFC 2311中的3.2節

 3.2 The application/pkcs7-mime Type The application/pkcs7-mime type is used to carry PKCS #7 objects of several types including envelopedData and signedData. The details of constructing these entities is described in subsequent sections. This section describes the general characteristics of the application/pkcs7-mime type. This MIME type always carries a single PKCS #7 object. The PKCS #7 object must always be BER encoding of the ASN.1 syntax describing the object. The contentInfo field of the carried PKCS #7 object always contains a MIME entity that is prepared as described in section 3.1. The contentInfo field must never be empty. Since PKCS #7 objects are binary data, in most cases base-64 transfer encoding is appropriate, in particular when used with SMTP transport. The transfer encoding used depends on the transport through which the object is to be sent, and is not a characteristic of the MIME type. Note that this discussion refers to the transfer encoding of the PKCS \\#7 object or "outside" MIME entity. It is completely distinct from, and unrelated to, the transfer encoding of the MIME entity secured by the PKCS #7 object, the "inside" object, which is described in section 3.1. Because there are several types of application/pkcs7-mime objects, a sending agent SHOULD do as much as possible to help a receiving agent know about the contents of the object without forcing the receiving agent to decode the ASN.1 for the object. The MIME headers of all application/pkcs7-mime objects SHOULD include the optional "smime- type" parameter, as described in the following sections. 

這基本上是一個以加密形式發送的安全電子郵件文件。 如果一切設置正確,則應該具有解密文件所需的公共密鑰。 如果沒有,請下載。

在您的情況下,傳輸編碼為Base64。 首先對附件進行解碼(如果到目前為止還沒有完成),然后處理二進制數據。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM