zbateson/gpg-interface

This package is abandoned and no longer maintained. The author suggests using the zbateson/crypt-interface package instead.

Cryptographic support for zbateson/mail-mime-parser (encryption, decryption, signing, verification)

Installs: 183

Dependents: 0

Suggesters: 0

Security: 0

Stars: 1

Watchers: 0

Forks: 0

pkg:composer/zbateson/gpg-interface

0.1 2019-03-25 00:48 UTC

This package is auto-updated.

Last update: 2026-02-13 18:46:32 UTC


README

Cryptographic support for zbateson/mail-mime-parser -- provides base classes and interfaces for encryption, decryption, signing, and verification of MIME email messages.

Total Downloads Latest Stable Version

composer require zbateson/mmp-crypt

Sponsors

SecuMailer

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 implementations
  • AbstractMimeCrypt -- base class implementing IMimeCrypt with stream handling
  • EncryptedMessage / EncryptedMimePart -- message/part classes that transparently expose decrypted content via getStream(), with getEncryptedStream() for accessing the original encrypted data

On its own, this package doesn't perform any cryptographic operations. Install an implementation package:

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.