PHP Class ParagonIE\GPGMailer\GPGMailer

Afficher le fichier Open project: paragonie/gpg-mailer Class Usage Examples

Protected Properties

Свойство Type Description
$mailer TransportInterface
$options array
$serverKeyFingerprint string

Méthodes publiques

Méthode Description
__construct ( TransportInterface $transport, array $options = [], string $serverKey = '' ) GPGMailer constructor.
decrypt ( Message $message ) : Message Encrypt the body of an email.
encrypt ( Message $message, string $fingerprint ) : Message Encrypt the body of an email.
encryptAndSign ( Message $message, string $fingerprint ) : Message Encrypt and sign the body of an email.
export ( string $fingerprint ) : string Get the public key corresponding to a fingerprint.
getTransport ( ) : TransportInterface Return the stored Transport.
import ( string $gpgKey ) : string Import a public key, return the fingerprint
send ( Message $message, string $fingerprint ) Encrypt then email a message
sendUnencrypted ( Message $message, boolean $force = false ) Email a message without encrypting it.
setPrivateKey ( string $serverKey ) : self Sets the private key for signing.
sign ( Message $message ) : Message Sign a message (but don't encrypt)
verify ( Message $message, string $fingerprint ) : boolean Verify a message

Method Details

__construct() public méthode

GPGMailer constructor.
public __construct ( TransportInterface $transport, array $options = [], string $serverKey = '' )
$transport TransportInterface
$options array For Crypt_GPG
$serverKey string

decrypt() public méthode

Encrypt the body of an email.
public decrypt ( Message $message ) : Message
$message Message
Résultat Message

encrypt() public méthode

Encrypt the body of an email.
public encrypt ( Message $message, string $fingerprint ) : Message
$message Message
$fingerprint string
Résultat Message

encryptAndSign() public méthode

Encrypt and sign the body of an email.
public encryptAndSign ( Message $message, string $fingerprint ) : Message
$message Message
$fingerprint string
Résultat Message

export() public méthode

Get the public key corresponding to a fingerprint.
public export ( string $fingerprint ) : string
$fingerprint string
Résultat string

getTransport() public méthode

Return the stored Transport.
public getTransport ( ) : TransportInterface
Résultat TransportInterface

import() public méthode

Import a public key, return the fingerprint
public import ( string $gpgKey ) : string
$gpgKey string An ASCII armored public key
Résultat string The GPG fingerprint for this key

send() public méthode

Encrypt then email a message
public send ( Message $message, string $fingerprint )
$message Message The message data
$fingerprint string Which public key fingerprint to use

sendUnencrypted() public méthode

Email a message without encrypting it.
public sendUnencrypted ( Message $message, boolean $force = false )
$message Message The message data
$force boolean Send even if we don't have a private key?

setPrivateKey() public méthode

Sets the private key for signing.
public setPrivateKey ( string $serverKey ) : self
$serverKey string
Résultat self

sign() public méthode

Sign a message (but don't encrypt)
public sign ( Message $message ) : Message
$message Message
Résultat Message

verify() public méthode

Verify a message
public verify ( Message $message, string $fingerprint ) : boolean
$message Message
$fingerprint string
Résultat boolean

Property Details

$mailer protected_oe property

protected TransportInterface $mailer
Résultat TransportInterface

$options protected_oe property

protected array $options
Résultat array

$serverKeyFingerprint protected_oe property

protected string $serverKeyFingerprint
Résultat string