Class Swift_Signers_DomainKeySigner

InheritanceSwift_Signers_DomainKeySigner
ImplementsSwift_Signers_HeaderSigner

DomainKey Signer used to apply DomainKeys Signature to a message.

Public Methods

Hide inherited methods

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

Property Details

$_canon protected property
protected string $_canon 'simple'
$_debugHeaders protected property
protected bool $_debugHeaders false
$_domainKeyHeader protected property
$_domainName protected property
protected string $_domainName null
$_hashAlgorithm protected property
protected string $_hashAlgorithm 'rsa-sha1'
$_ignoredHeaders protected property
protected array $_ignoredHeaders = []
$_privateKey protected property
protected string $_privateKey null
$_selector protected property
protected string $_selector null
$_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 )
$header
_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_DomainKeySigner 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 Swift_Signers_DomainKeySigner 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 Swift_Signers_DomainKeySigner 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 Swift_Signers_DomainKeySigner 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_DomainKeySigner ignoreHeader ( $header_name )
$header_name string
newInstance() public static method

Instanciate DomainKeySigner.

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

Resets internal states.

public Swift_Signers_DomainKeySigner reset ( )
setCanon() public method

Set the canonicalization algorithm.

public Swift_Signers_DomainKeySigner setCanon ( $canon )
$canon string

Simple | nofws defaults to simple

setDebugHeaders() public method

Enable / disable the DebugHeaders.

public Swift_Signers_DomainKeySigner 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_DomainKeySigner setHashAlgorithm ( $hash )
$hash string
setHeaders() public method

Set the headers to sign.

public Swift_Signers_DomainKeySigner setHeaders ( Swift_Mime_HeaderSet $headers )
$headers Swift_Mime_HeaderSet
setSignerIdentity() public method

Set the signer identity.

public Swift_Signers_DomainKeySigner 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 Swift_Signers_DomainKeySigner 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 Swift_Signers_DomainKeySigner write ( $bytes )
$bytes string
throws Swift_IoException