Class Swift_Signers_DKIMSigner

InheritanceSwift_Signers_DKIMSigner
ImplementsSwift_Signers_HeaderSigner
SubclassesSwift_Signers_OpenDKIMSigner

DKIM Signer used to apply DKIM Signature to a message.

Public Methods

Hide inherited methods

MethodDescriptionDefined By
__construct() Constructor. Swift_Signers_DKIMSigner
addSignature() Add the signature to the given Headers. Swift_Signers_DKIMSigner
bind() Attach $is to this stream. Swift_Signers_DKIMSigner
commit() For any bytes that are currently buffered inside the stream, force them off the buffer. Swift_Signers_DKIMSigner
endBody() End Body. Swift_Signers_DKIMSigner
flushBuffers() Flush the contents of the stream (empty it) and set the internal pointer to the beginning. Swift_Signers_DKIMSigner
getAlteredHeaders() Returns the list of Headers Tampered by this plugin. Swift_Signers_DKIMSigner
ignoreHeader() Adds an ignored Header. Swift_Signers_DKIMSigner
newInstance() Instanciate DKIMSigner. Swift_Signers_DKIMSigner
reset() Reset the Signer. Swift_Signers_DKIMSigner
setBodyCanon() Set the body canonicalization algorithm. Swift_Signers_DKIMSigner
setBodySignedLen() Set the length of the body to sign. Swift_Signers_DKIMSigner
setDebugHeaders() Enable / disable the DebugHeaders. Swift_Signers_DKIMSigner
setHashAlgorithm() Set hash_algorithm, must be one of rsa-sha256 | rsa-sha1 defaults to rsa-sha256. Swift_Signers_DKIMSigner
setHeaderCanon() Set the header canonicalization algorithm. Swift_Signers_DKIMSigner
setHeaders() Set the headers to sign. Swift_Signers_DKIMSigner
setSignatureExpiration() Set the signature expiration timestamp. Swift_Signers_DKIMSigner
setSignatureTimestamp() Set the signature timestamp. Swift_Signers_DKIMSigner
setSignerIdentity() Set the signer identity. Swift_Signers_DKIMSigner
startBody() Start Body. Swift_Signers_DKIMSigner
unbind() Remove an already bound stream. Swift_Signers_DKIMSigner
write() Writes $bytes to the end of the stream. Swift_Signers_DKIMSigner

Property Details

$_bodyCanon protected property
protected string $_bodyCanon 'simple'
$_bodyLen protected property
protected int $_bodyLen 0
$_debugHeaders protected property
protected bool $_debugHeaders false
$_dkimHeader protected property
$_domainName protected property
protected string $_domainName null
$_hashAlgorithm protected property
protected string $_hashAlgorithm 'rsa-sha1'
$_headerCanon protected property
protected string $_headerCanon 'simple'
$_ignoredHeaders protected property
protected array $_ignoredHeaders = ['return-path' => true]
$_maxLen protected property
protected int $_maxLen PHP_INT_MAX
$_privateKey protected property
protected string $_privateKey null
$_selector protected property
protected string $_selector null
$_showLen protected property
protected bool $_showLen false
$_signatureExpiration protected property
protected int $_signatureExpiration false
$_signatureTimestamp protected property
protected mixed $_signatureTimestamp true
$_signedHeaders protected property
protected array $_signedHeaders = []
$_signerIdentity protected property
protected string $_signerIdentity null

Method Details

__construct() public method

Constructor.

public void __construct ( $privateKey, $domainName, $selector )
$privateKey string
$domainName string
$selector string
_addHeader() protected method

protected void _addHeader ( $header, $is_sig false )
$header
$is_sig
_canonicalizeBody() protected method

protected void _canonicalizeBody ( $string )
$string
_endOfBody() protected method

protected void _endOfBody ( )
_endOfHeaders() protected method

protected void _endOfHeaders ( )
addSignature() public method

Add the signature to the given Headers.

public Swift_Signers_DKIMSigner addSignature ( Swift_Mime_HeaderSet $headers )
$headers Swift_Mime_HeaderSet
bind() public method

Attach $is to this stream.

The stream acts as an observer, receiving all data that is written. All {@link write()} and {@link flushBuffers()} operations will be mirrored.

public void bind ( Swift_InputByteStream $is )
$is Swift_InputByteStream
commit() public method

For any bytes that are currently buffered inside the stream, force them off the buffer.

public void commit ( )
throws Swift_IoException
endBody() public method

End Body.

public void endBody ( )
flushBuffers() public method

Flush the contents of the stream (empty it) and set the internal pointer to the beginning.

public void flushBuffers ( )
throws Swift_IoException
getAlteredHeaders() public method

Returns the list of Headers Tampered by this plugin.

public array getAlteredHeaders ( )
ignoreHeader() public method

Adds an ignored Header.

public Swift_Signers_DKIMSigner ignoreHeader ( $header_name )
$header_name string
newInstance() public static method

Instanciate DKIMSigner.

public static Swift_Signers_DKIMSigner newInstance ( $privateKey, $domainName, $selector )
$privateKey string
$domainName string
$selector string
reset() public method

Reset the Signer.

See also Swift_Signer::reset().

public void reset ( )
setBodyCanon() public method

Set the body canonicalization algorithm.

public Swift_Signers_DKIMSigner setBodyCanon ( $canon )
$canon string
setBodySignedLen() public method

Set the length of the body to sign.

public Swift_Signers_DKIMSigner setBodySignedLen ( $len )
$len mixed

(bool or int)

setDebugHeaders() public method

Enable / disable the DebugHeaders.

public Swift_Signers_DKIMSigner setDebugHeaders ( $debug )
$debug bool
setHashAlgorithm() public method

Set hash_algorithm, must be one of rsa-sha256 | rsa-sha1 defaults to rsa-sha256.

public Swift_Signers_DKIMSigner setHashAlgorithm ( $hash )
$hash string
setHeaderCanon() public method

Set the header canonicalization algorithm.

public Swift_Signers_DKIMSigner setHeaderCanon ( $canon )
$canon string
setHeaders() public method

Set the headers to sign.

public Swift_Signers_DKIMSigner setHeaders ( Swift_Mime_HeaderSet $headers )
$headers Swift_Mime_HeaderSet
setSignatureExpiration() public method

Set the signature expiration timestamp.

public Swift_Signers_DKIMSigner setSignatureExpiration ( $time )
$time int

A timestamp

setSignatureTimestamp() public method

Set the signature timestamp.

public Swift_Signers_DKIMSigner setSignatureTimestamp ( $time )
$time int

A timestamp

setSignerIdentity() public method

Set the signer identity.

public Swift_Signers_DKIMSigner setSignerIdentity ( $identity )
$identity string
startBody() public method

Start Body.

public void startBody ( )
unbind() public method

Remove an already bound stream.

If $is is not bound, no errors will be raised. If the stream currently has any buffered data it will be written to $is before unbinding occurs.

public void unbind ( Swift_InputByteStream $is )
$is Swift_InputByteStream
write() public method

Writes $bytes to the end of the stream.

Writing may not happen immediately if the stream chooses to buffer. If you want to write these bytes with immediate effect, call {@link commit()} after calling write().

This method returns the sequence ID of the write (i.e. 1 for first, 2 for second, etc etc).

public int write ( $bytes )
$bytes string
throws Swift_IoException