TYPO3  7.6
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes | List of all members
Swift_Signers_DKIMSigner Class Reference
Inheritance diagram for Swift_Signers_DKIMSigner:
Swift_Signers_HeaderSigner Swift_Signer Swift_InputByteStream Swift_Signers_OpenDKIMSigner

Public Member Functions

 __construct ($privateKey, $domainName, $selector)
 
 reset ()
 
 write ($bytes)
 
 commit ()
 
 bind (Swift_InputByteStream $is)
 
 unbind (Swift_InputByteStream $is)
 
 flushBuffers ()
 
 setHashAlgorithm ($hash)
 
 setBodyCanon ($canon)
 
 setHeaderCanon ($canon)
 
 setSignerIdentity ($identity)
 
 setBodySignedLen ($len)
 
 setSignatureTimestamp ($time)
 
 setSignatureExpiration ($time)
 
 setDebugHeaders ($debug)
 
 startBody ()
 
 endBody ()
 
 getAlteredHeaders ()
 
 ignoreHeader ($header_name)
 
 setHeaders (Swift_Mime_HeaderSet $headers)
 
 addSignature (Swift_Mime_HeaderSet $headers)
 

Static Public Member Functions

static newInstance ($privateKey, $domainName, $selector)
 

Protected Member Functions

 _addHeader ($header, $is_sig=false)
 
 _endOfHeaders ()
 
 _canonicalizeBody ($string)
 
 _endOfBody ()
 

Protected Attributes

 $_privateKey
 
 $_domainName
 
 $_selector
 
 $_hashAlgorithm = 'rsa-sha1'
 
 $_bodyCanon = 'simple'
 
 $_headerCanon = 'simple'
 
 $_ignoredHeaders = array()
 
 $_signerIdentity
 
 $_bodyLen = 0
 
 $_maxLen = PHP_INT_MAX
 
 $_showLen = false
 
 $_signatureTimestamp = true
 
 $_signatureExpiration = false
 
 $_debugHeaders = false
 
 $_signedHeaders = array()
 
 $_dkimHeader
 

Private Member Functions

 _addToBodyHash ($string)
 
 _addToHeaderHash ($header)
 
 _getEncryptedHash ()
 

Private Attributes

 $_debugHeadersData = ''
 
 $_bodyHash = ''
 
 $_headerHashHandler
 
 $_bodyHashHandler
 
 $_headerHash
 
 $_headerCanonData = ''
 
 $_bodyCanonEmptyCounter = 0
 
 $_bodyCanonIgnoreStart = 2
 
 $_bodyCanonSpace = false
 
 $_bodyCanonLastChar = null
 
 $_bodyCanonLine = ''
 
 $_bound = array()
 

Detailed Description

DKIM Signer used to apply DKIM Signature to a message.

Author
Xavier De Cock xdeco.nosp@m.ck@g.nosp@m.mail..nosp@m.com

Definition at line 16 of file DKIMSigner.php.

Constructor & Destructor Documentation

__construct (   $privateKey,
  $domainName,
  $selector 
)

Constructor.

Parameters
string$privateKey
string$domainName
string$selector

Definition at line 178 of file DKIMSigner.php.

Member Function Documentation

_addHeader (   $header,
  $is_sig = false 
)
protected

Definition at line 575 of file DKIMSigner.php.

References _addToHeaderHash().

Referenced by addSignature(), and setHeaders().

_addToBodyHash (   $string)
private

Definition at line 658 of file DKIMSigner.php.

Referenced by _canonicalizeBody(), and _endOfBody().

_addToHeaderHash (   $header)
private

Definition at line 669 of file DKIMSigner.php.

Referenced by _addHeader().

_canonicalizeBody (   $string)
protected

Definition at line 596 of file DKIMSigner.php.

References $_bodyCanonEmptyCounter, $_bodyCanonIgnoreStart, and _addToBodyHash().

Referenced by write().

_endOfBody ( )
protected

Definition at line 649 of file DKIMSigner.php.

References _addToBodyHash().

Referenced by endBody().

_endOfHeaders ( )
protected

Definition at line 591 of file DKIMSigner.php.

Referenced by addSignature().

_getEncryptedHash ( )
private
Exceptions
Swift_SwiftException
Returns
string

Definition at line 682 of file DKIMSigner.php.

Referenced by addSignature().

addSignature ( Swift_Mime_HeaderSet  $headers)
bind ( Swift_InputByteStream  $is)

Attach $is to this stream. The stream acts as an observer, receiving all data that is written. All write() and flushBuffers() operations will be mirrored.

Parameters
Swift_InputByteStream$is

Implements Swift_InputByteStream.

Definition at line 261 of file DKIMSigner.php.

commit ( )

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

Exceptions
Swift_IoException

Implements Swift_InputByteStream.

Definition at line 248 of file DKIMSigner.php.

endBody ( )

End Body.

Implements Swift_Signers_HeaderSigner.

Definition at line 456 of file DKIMSigner.php.

References _endOfBody().

flushBuffers ( )

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

Exceptions
Swift_IoException

Implements Swift_InputByteStream.

Definition at line 297 of file DKIMSigner.php.

References reset().

getAlteredHeaders ( )

Returns the list of Headers Tampered by this plugin.

Returns
array

Implements Swift_Signers_HeaderSigner.

Definition at line 466 of file DKIMSigner.php.

ignoreHeader (   $header_name)

Adds an ignored Header.

Parameters
string$header_name
Returns
Swift_Signers_DKIMSigner

Implements Swift_Signers_HeaderSigner.

Definition at line 482 of file DKIMSigner.php.

static newInstance (   $privateKey,
  $domainName,
  $selector 
)
static

Instanciate DKIMSigner.

Parameters
string$privateKey
string$domainName
string$selector
Returns
Swift_Signers_DKIMSigner

Definition at line 195 of file DKIMSigner.php.

reset ( )

Reset the Signer.

See Also
Swift_Signer::reset()

Implements Swift_Signer.

Definition at line 205 of file DKIMSigner.php.

Referenced by flushBuffers().

setBodyCanon (   $canon)

Set the body canonicalization algorithm.

Parameters
string$canon
Returns
Swift_Signers_DKIMSigner

Definition at line 328 of file DKIMSigner.php.

setBodySignedLen (   $len)

Set the length of the body to sign.

Parameters
mixed$len(bool or int)
Returns
Swift_Signers_DKIMSigner

Definition at line 378 of file DKIMSigner.php.

References elseif.

setDebugHeaders (   $debug)

Enable / disable the DebugHeaders.

Parameters
bool$debug
Returns
Swift_Signers_DKIMSigner

Definition at line 429 of file DKIMSigner.php.

setHashAlgorithm (   $hash)

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

Parameters
string$hash
Returns
Swift_Signers_DKIMSigner

Definition at line 309 of file DKIMSigner.php.

setHeaderCanon (   $canon)

Set the header canonicalization algorithm.

Parameters
string$canon
Returns
Swift_Signers_DKIMSigner

Definition at line 346 of file DKIMSigner.php.

setHeaders ( Swift_Mime_HeaderSet  $headers)
setSignatureExpiration (   $time)

Set the signature expiration timestamp.

Parameters
timestamp$time
Returns
Swift_Signers_DKIMSigner

Definition at line 415 of file DKIMSigner.php.

setSignatureTimestamp (   $time)

Set the signature timestamp.

Parameters
timestamp$time
Returns
Swift_Signers_DKIMSigner

Definition at line 401 of file DKIMSigner.php.

setSignerIdentity (   $identity)

Set the signer identity.

Parameters
string$identity
Returns
Swift_Signers_DKIMSigner

Definition at line 364 of file DKIMSigner.php.

startBody ( )

Start Body.

Implements Swift_Signers_HeaderSigner.

Definition at line 439 of file DKIMSigner.php.

unbind ( Swift_InputByteStream  $is)

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.

Parameters
Swift_InputByteStream$is

Implements Swift_InputByteStream.

Definition at line 277 of file DKIMSigner.php.

write (   $bytes)

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 commit() after calling write().

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

Parameters
string$bytes
Exceptions
Swift_IoException
Returns
int

Implements Swift_InputByteStream.

Definition at line 234 of file DKIMSigner.php.

References _canonicalizeBody().

Member Data Documentation

$_bodyCanon = 'simple'
protected

Definition at line 51 of file DKIMSigner.php.

Referenced by addSignature().

$_bodyCanonEmptyCounter = 0
private

Definition at line 159 of file DKIMSigner.php.

Referenced by _canonicalizeBody().

$_bodyCanonIgnoreStart = 2
private

Definition at line 161 of file DKIMSigner.php.

Referenced by _canonicalizeBody().

$_bodyCanonLastChar = null
private

Definition at line 165 of file DKIMSigner.php.

$_bodyCanonLine = ''
private

Definition at line 167 of file DKIMSigner.php.

$_bodyCanonSpace = false
private

Definition at line 163 of file DKIMSigner.php.

$_bodyHash = ''
private

Definition at line 137 of file DKIMSigner.php.

$_bodyHashHandler
private

Definition at line 153 of file DKIMSigner.php.

$_bodyLen = 0
protected

Definition at line 79 of file DKIMSigner.php.

Referenced by addSignature(), and Swift_Signers_OpenDKIMSigner\setHeaders().

$_bound = array()
private

Definition at line 169 of file DKIMSigner.php.

$_debugHeaders = false
protected

Definition at line 115 of file DKIMSigner.php.

$_debugHeadersData = ''
private

Definition at line 130 of file DKIMSigner.php.

$_dkimHeader
protected

Definition at line 144 of file DKIMSigner.php.

$_domainName
protected

Definition at line 30 of file DKIMSigner.php.

$_hashAlgorithm = 'rsa-sha1'
protected

Definition at line 44 of file DKIMSigner.php.

$_headerCanon = 'simple'
protected

Definition at line 58 of file DKIMSigner.php.

Referenced by addSignature().

$_headerCanonData = ''
private

Definition at line 157 of file DKIMSigner.php.

$_headerHash
private

Definition at line 155 of file DKIMSigner.php.

$_headerHashHandler
private

Definition at line 151 of file DKIMSigner.php.

$_ignoredHeaders = array()
protected

Definition at line 65 of file DKIMSigner.php.

$_maxLen = PHP_INT_MAX
protected

Definition at line 86 of file DKIMSigner.php.

$_privateKey
protected

Definition at line 23 of file DKIMSigner.php.

$_selector
protected

Definition at line 37 of file DKIMSigner.php.

$_showLen = false
protected

Definition at line 93 of file DKIMSigner.php.

$_signatureExpiration = false
protected

Definition at line 108 of file DKIMSigner.php.

Referenced by addSignature().

$_signatureTimestamp = true
protected

Definition at line 100 of file DKIMSigner.php.

Referenced by addSignature().

$_signedHeaders = array()
protected

Definition at line 123 of file DKIMSigner.php.

$_signerIdentity
protected

Definition at line 72 of file DKIMSigner.php.