Documentation

Swift_Signers_SMimeSigner
in package
implements Swift_Signers_BodySigner

MIME Message Signer used to apply S/MIME Signature/Encryption to a message.

Tags
author

Romain-Geissler

author

Sebastiaan Stok s.stok@rollerscapes.net

author

Jan Flora jf@penneo.com

Interfaces, Classes and Traits

Swift_Signers_BodySigner
Body Signer Interface used to apply Body-Based Signature to a message.

Table of Contents

$encryptCert  : mixed
$encryptCipher  : mixed
$encryptLevel  : mixed
$encryptOptions  : mixed
$extraCerts  : mixed
$headerFactory  : Swift_Mime_SimpleHeaderFactory
$replacementFactory  : Swift_StreamFilters_StringReplacementFilterFactory
$signCertificate  : mixed
$signLevel  : mixed
$signOptions  : mixed
$signPrivateKey  : mixed
$signThenEncrypt  : mixed
$wrapFullMessage  : mixed
__construct()  : mixed
Constructor.
getAlteredHeaders()  : array<string|int, mixed>
Return the list of header a signer might tamper.
getSignCertificate()  : string
getSignPrivateKey()  : string
isSignThenEncrypt()  : bool
reset()  : $this
Resets internal states.
setEncryptCertificate()  : $this
Set the certificate location to use for encryption.
setSignCertificate()  : $this
Set the certificate location to use for signing.
setSignThenEncrypt()  : $this
Set perform signing before encryption.
setWrapFullMessage()  : $this
Specify whether to wrap the entire MIME message in the S/MIME message.
signMessage()  : $this
Change the Swift_Message to apply the signing.
clearAllHeaders()  : mixed
Remove all headers from a Swift message.
copyFromOpenSSLOutput()  : mixed
copyHeader()  : mixed
Copy a single header from one Swift message to another.
copyHeaders()  : mixed
Copy named headers from one Swift message to another.
parseSSLOutput()  : mixed
parseStream()  : array<string|int, mixed>
This message will parse the headers of a MIME email byte stream and return an array that contains the headers as an associative array and the email body as a string.
smimeEncryptMessage()  : mixed
Encrypt a Swift message.
smimeSignMessage()  : mixed
Sign a Swift message.
streamToMime()  : mixed
Merges an OutputByteStream from OpenSSL to a Swift_Message.
wrapMimeMessage()  : Swift_MimePart
Wraps a Swift_Message in a message/rfc822 MIME part.

Properties

$signThenEncrypt

protected mixed $signThenEncrypt = rue

$wrapFullMessage

protected mixed $wrapFullMessage = alse

Methods

__construct()

Constructor.

public __construct([string|null $signCertificate = null ][, string|null $signPrivateKey = null ][, string|null $encryptCertificate = null ]) : mixed
Parameters
$signCertificate : string|null = null
$signPrivateKey : string|null = null
$encryptCertificate : string|null = null
Return values
mixed

getAlteredHeaders()

Return the list of header a signer might tamper.

public getAlteredHeaders() : array<string|int, mixed>
Return values
array<string|int, mixed>

getSignCertificate()

public getSignCertificate() : string
Return values
string

getSignPrivateKey()

public getSignPrivateKey() : string
Return values
string

isSignThenEncrypt()

public isSignThenEncrypt() : bool
Return values
bool

reset()

Resets internal states.

public reset() : $this
Return values
$this

setEncryptCertificate()

Set the certificate location to use for encryption.

public setEncryptCertificate(string|array<string|int, mixed> $recipientCerts[, int $cipher = null ]) : $this
Parameters
$recipientCerts : string|array<string|int, mixed>

Either an single X.509 certificate, or an assoc array of X.509 certificates.

$cipher : int = null
Tags
see
https://secure.php.net/manual/en/openssl.pkcs7.flags.php
see
https://secure.php.net/manual/en/openssl.ciphers.php
Return values
$this

setSignCertificate()

Set the certificate location to use for signing.

public setSignCertificate(string $certificate[, string|array<string|int, mixed> $privateKey = null ][, int $signOptions = PKCS7_DETACHED ][, string $extraCerts = null ]) : $this
Parameters
$certificate : string
$privateKey : string|array<string|int, mixed> = null

If the key needs an passphrase use array('file-location', 'passphrase') instead

$signOptions : int = PKCS7_DETACHED

Bitwise operator options for openssl_pkcs7_sign()

$extraCerts : string = null

A file containing intermediate certificates needed by the signing certificate

Tags
see
https://secure.php.net/manual/en/openssl.pkcs7.flags.php
Return values
$this

setSignThenEncrypt()

Set perform signing before encryption.

public setSignThenEncrypt([bool $signThenEncrypt = true ]) : $this

The default is to first sign the message and then encrypt. But some older mail clients, namely Microsoft Outlook 2000 will work when the message first encrypted. As this goes against the official specs, its recommended to only use 'encryption -> signing' when specifically targeting these 'broken' clients.

Parameters
$signThenEncrypt : bool = true
Return values
$this

setWrapFullMessage()

Specify whether to wrap the entire MIME message in the S/MIME message.

public setWrapFullMessage(bool $wrap) : $this

According to RFC5751 section 3.1: In order to protect outer, non-content-related message header fields (for instance, the "Subject", "To", "From", and "Cc" fields), the sending client MAY wrap a full MIME message in a message/rfc822 wrapper in order to apply S/MIME security services to these header fields. It is up to the receiving client to decide how to present this "inner" header along with the unprotected "outer" header.

Parameters
$wrap : bool
Return values
$this

copyHeaders()

Copy named headers from one Swift message to another.

protected copyHeaders(Swift_Message $fromMessage, Swift_Message $toMessage[, array<string|int, mixed> $headers = [] ]) : mixed
Parameters
$fromMessage : Swift_Message
$toMessage : Swift_Message
$headers : array<string|int, mixed> = []
Return values
mixed

parseStream()

This message will parse the headers of a MIME email byte stream and return an array that contains the headers as an associative array and the email body as a string.

protected parseStream(Swift_OutputByteStream $emailStream) : array<string|int, mixed>
Parameters
$emailStream : Swift_OutputByteStream
Return values
array<string|int, mixed>

Search results