zbateson/mmp-crypt
Composer 安装命令:
composer require zbateson/mmp-crypt
包简介
Cryptographic support for zbateson/mail-mime-parser (encryption, decryption, signing, verification)
README 文档
README
Cryptographic support for zbateson/mail-mime-parser -- provides base classes and interfaces for encryption, decryption, signing, and verification of MIME email messages.
composer require zbateson/mmp-crypt
Sponsors
A huge thank you to all my sponsors. <3
If this project's helped you, please consider sponsoring me.
Requirements
PHP 8.1 or newer, and zbateson/mail-mime-parser 4.x.
Description
This is the base package for mail-mime-parser's cryptographic plugin system. It provides:
IMimeCrypt-- interface for encryption/decryption/signing/verification implementationsAbstractMimeCrypt-- base class implementingIMimeCryptwith stream handlingEncryptedMessage/EncryptedMimePart-- message/part classes that transparently expose decrypted content viagetStream(), withgetEncryptedStream()for accessing the original encrypted data
On its own, this package doesn't perform any cryptographic operations. Install an implementation package:
- zbateson/mmp-crypt-smime -- S/MIME via PHP's OpenSSL extension
- zbateson/mmp-crypt-gpg -- PGP/MIME via the PECL gnupg extension
Usage
use ZBateson\MailMimeParser\Message; // Parsing an encrypted message automatically uses the registered // IMimeCrypt implementation to decrypt it. $message = Message::from($rawEmail, false); // If the message was encrypted, it will be an EncryptedMessage instance. // getStream() / getTextContent() / etc. return decrypted content by default. echo $message->getTextContent(); // Access the original encrypted stream if needed if ($message instanceof \ZBateson\MmpCrypt\EncryptedMessage) { $encryptedStream = $message->getEncryptedStream(); }
License
BSD licensed - please see license agreement.
统计信息
- 总下载量: 1.01k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 2
- 依赖项目数: 2
- 推荐数: 0
其他信息
- 授权协议: BSD-2-Clause
- 更新时间: 2026-02-13