PHP Class Swift_Signers_DomainKeySigner

Author: Xavier De Cock ([email protected])
Inheritance: implements Swift_Signers_HeaderSigner
Mostrar archivo Open project: swiftmailer/swiftmailer

Protected Properties

Property Type Description
$canon string Canonisation method.
$debugHeaders boolean Must we embed signed headers?
$domainKeyHeader Swift_Mime_Headers_ParameterizedHeader Stores the signature header.
$domainName string DomainName.
$hashAlgorithm string Hash algorithm used.
$ignoredHeaders array Headers not being signed.
$privateKey string PrivateKey.
$selector string Selector.
$signerIdentity string Signer identity.

Public Methods

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

Protected Methods

Method Description
addHeader ( $header ) * Private helpers
canonicalizeBody ( $string )
endOfBody ( )
endOfHeaders ( )

Private Methods

Method Description
addToHash ( $string )
getEncryptedHash ( ) : string
startHash ( )

Method Details

__construct() public method

Constructor.
public __construct ( string $privateKey, string $domainName, string $selector )
$privateKey string
$domainName string
$selector string

addHeader() protected method

* Private helpers
protected addHeader ( $header )

addSignature() public method

Add the signature to the given Headers.
public addSignature ( Swift_Mime_HeaderSet $headers ) : Swift_Signers_DomainKeySigner
$headers Swift_Mime_HeaderSet
return Swift_Signers_DomainKeySigner

bind() public method

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

canonicalizeBody() protected method

protected canonicalizeBody ( $string )

commit() public method

For any bytes that are currently buffered inside the stream, force them off the buffer.
public commit ( ) : Swift_Signers_DomainKeySigner
return Swift_Signers_DomainKeySigner

endBody() public method

End Body.
public endBody ( )

endOfBody() protected method

protected endOfBody ( )

endOfHeaders() protected method

protected endOfHeaders ( )

flushBuffers() public method

Flush the contents of the stream (empty it) and set the internal pointer to the beginning.
public flushBuffers ( ) : Swift_Signers_DomainKeySigner
return Swift_Signers_DomainKeySigner

getAlteredHeaders() public method

Returns the list of Headers Tampered by this plugin.
public getAlteredHeaders ( ) : array
return array

ignoreHeader() public method

Adds an ignored Header.
public ignoreHeader ( string $header_name ) : Swift_Signers_DomainKeySigner
$header_name string
return Swift_Signers_DomainKeySigner

reset() public method

Resets internal states.
public reset ( ) : Swift_Signers_DomainKeySigner
return Swift_Signers_DomainKeySigner

setCanon() public method

Set the canonicalization algorithm.
public setCanon ( string $canon ) : Swift_Signers_DomainKeySigner
$canon string simple | nofws defaults to simple
return Swift_Signers_DomainKeySigner

setDebugHeaders() public method

Enable / disable the DebugHeaders.
public setDebugHeaders ( boolean $debug ) : Swift_Signers_DomainKeySigner
$debug boolean
return Swift_Signers_DomainKeySigner

setHashAlgorithm() public method

Set hash_algorithm, must be one of rsa-sha256 | rsa-sha1 defaults to rsa-sha256.
public setHashAlgorithm ( string $hash ) : Swift_Signers_DomainKeySigner
$hash string
return Swift_Signers_DomainKeySigner

setHeaders() public method

Set the headers to sign.
public setHeaders ( Swift_Mime_HeaderSet $headers ) : Swift_Signers_DomainKeySigner
$headers Swift_Mime_HeaderSet
return Swift_Signers_DomainKeySigner

setSignerIdentity() public method

Set the signer identity.
public setSignerIdentity ( string $identity ) : Swift_Signers_DomainKeySigner
$identity string
return Swift_Signers_DomainKeySigner

startBody() public method

Start Body.
public startBody ( )

unbind() public method

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 unbind ( Swift_InputByteStream $is ) : Swift_Signers_DomainKeySigner
$is Swift_InputByteStream
return Swift_Signers_DomainKeySigner

write() public method

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 write ( string $bytes ) : Swift_Signers_DomainKeySigner
$bytes string
return Swift_Signers_DomainKeySigner

Property Details

$canon protected_oe property

Canonisation method.
protected string $canon
return string

$debugHeaders protected_oe property

Must we embed signed headers?
protected bool $debugHeaders
return boolean

$domainKeyHeader protected_oe property

Stores the signature header.
protected Swift_Mime_Headers_ParameterizedHeader $domainKeyHeader
return Swift_Mime_Headers_ParameterizedHeader

$domainName protected_oe property

DomainName.
protected string $domainName
return string

$hashAlgorithm protected_oe property

Hash algorithm used.
protected string $hashAlgorithm
return string

$ignoredHeaders protected_oe property

Headers not being signed.
protected array $ignoredHeaders
return array

$privateKey protected_oe property

PrivateKey.
protected string $privateKey
return string

$selector protected_oe property

Selector.
protected string $selector
return string

$signerIdentity protected_oe property

Signer identity.
protected string $signerIdentity
return string