PHP Class Swift_Signers_DKIMSigner

Author: Xavier De Cock ([email protected])
Inheritance: implements Swift_Signers_HeaderSigner
Afficher le fichier Open project: swiftmailer/swiftmailer Class Usage Examples

Protected Properties

Свойство Type Description
$bodyCanon string Body canon method.
$bodyLen integer BodyLength.
$debugHeaders boolean Must we embed signed headers?
$dkimHeader Swift_Mime_Headers_ParameterizedHeader Stores the signature header.
$domainName string DomainName.
$hashAlgorithm string Hash algorithm used.
$headerCanon string Header canon method.
$ignoredHeaders array Headers not being signed.
$maxLen integer Maximum signedLen.
$privateKey string PrivateKey.
$selector string Selector.
$showLen boolean Embbed bodyLen in signature.
$signatureExpiration integer When will the signature expires false means not embedded, if sigTimestamp is auto Expiration is relative, otherwhise it's absolute.
$signatureTimestamp mixed When the signature has been applied (true means time()), false means not embedded.
$signedHeaders array Headers used to generate hash.
$signerIdentity string Signer identity.

Méthodes publiques

Méthode Description
__construct ( string $privateKey, string $domainName, string $selector ) Constructor.
addSignature ( Swift_Mime_HeaderSet $headers ) : Swift_Signers_DKIMSigner Add the signature to the given Headers.
bind ( Swift_InputByteStream $is ) Attach $is to this stream.
commit ( ) For any bytes that are currently buffered inside the stream, force them off the buffer.
endBody ( ) End Body.
flushBuffers ( ) 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_DKIMSigner Adds an ignored Header.
reset ( ) Reset the Signer.
setBodyCanon ( string $canon ) : Swift_Signers_DKIMSigner Set the body canonicalization algorithm.
setBodySignedLen ( mixed $len ) : Swift_Signers_DKIMSigner Set the length of the body to sign.
setDebugHeaders ( boolean $debug ) : Swift_Signers_DKIMSigner Enable / disable the DebugHeaders.
setHashAlgorithm ( string $hash ) : Swift_Signers_DKIMSigner Set hash_algorithm, must be one of rsa-sha256 | rsa-sha1 defaults to rsa-sha256.
setHeaderCanon ( string $canon ) : Swift_Signers_DKIMSigner Set the header canonicalization algorithm.
setHeaders ( Swift_Mime_HeaderSet $headers ) : Swift_Signers_DKIMSigner Set the headers to sign.
setSignatureExpiration ( integer $time ) : Swift_Signers_DKIMSigner Set the signature expiration timestamp.
setSignatureTimestamp ( integer $time ) : Swift_Signers_DKIMSigner Set the signature timestamp.
setSignerIdentity ( string $identity ) : Swift_Signers_DKIMSigner Set the signer identity.
startBody ( ) Start Body.
unbind ( Swift_InputByteStream $is ) Remove an already bound stream.
write ( string $bytes ) : integer Writes $bytes to the end of the stream.

Méthodes protégées

Méthode Description
addHeader ( $header, $is_sig = false ) * Private helpers
canonicalizeBody ( $string )
endOfBody ( )

Private Methods

Méthode Description
addToBodyHash ( $string )
addToHeaderHash ( $header )
getEncryptedHash ( ) : string

Method Details

__construct() public méthode

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

addHeader() protected méthode

* Private helpers
protected addHeader ( $header, $is_sig = false )

addSignature() public méthode

Add the signature to the given Headers.
public addSignature ( Swift_Mime_HeaderSet $headers ) : Swift_Signers_DKIMSigner
$headers Swift_Mime_HeaderSet
Résultat Swift_Signers_DKIMSigner

bind() public méthode

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 )
$is Swift_InputByteStream

canonicalizeBody() protected méthode

protected canonicalizeBody ( $string )

commit() public méthode

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

endBody() public méthode

End Body.
public endBody ( )

endOfBody() protected méthode

protected endOfBody ( )

flushBuffers() public méthode

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

getAlteredHeaders() public méthode

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

ignoreHeader() public méthode

Adds an ignored Header.
public ignoreHeader ( string $header_name ) : Swift_Signers_DKIMSigner
$header_name string
Résultat Swift_Signers_DKIMSigner

reset() public méthode

Reset the Signer.
See also: Swift_Signer::reset()
public reset ( )

setBodyCanon() public méthode

Set the body canonicalization algorithm.
public setBodyCanon ( string $canon ) : Swift_Signers_DKIMSigner
$canon string
Résultat Swift_Signers_DKIMSigner

setBodySignedLen() public méthode

Set the length of the body to sign.
public setBodySignedLen ( mixed $len ) : Swift_Signers_DKIMSigner
$len mixed (bool or int)
Résultat Swift_Signers_DKIMSigner

setDebugHeaders() public méthode

Enable / disable the DebugHeaders.
public setDebugHeaders ( boolean $debug ) : Swift_Signers_DKIMSigner
$debug boolean
Résultat Swift_Signers_DKIMSigner

setHashAlgorithm() public méthode

Set hash_algorithm, must be one of rsa-sha256 | rsa-sha1 defaults to rsa-sha256.
public setHashAlgorithm ( string $hash ) : Swift_Signers_DKIMSigner
$hash string
Résultat Swift_Signers_DKIMSigner

setHeaderCanon() public méthode

Set the header canonicalization algorithm.
public setHeaderCanon ( string $canon ) : Swift_Signers_DKIMSigner
$canon string
Résultat Swift_Signers_DKIMSigner

setHeaders() public méthode

Set the headers to sign.
public setHeaders ( Swift_Mime_HeaderSet $headers ) : Swift_Signers_DKIMSigner
$headers Swift_Mime_HeaderSet
Résultat Swift_Signers_DKIMSigner

setSignatureExpiration() public méthode

Set the signature expiration timestamp.
public setSignatureExpiration ( integer $time ) : Swift_Signers_DKIMSigner
$time integer A timestamp
Résultat Swift_Signers_DKIMSigner

setSignatureTimestamp() public méthode

Set the signature timestamp.
public setSignatureTimestamp ( integer $time ) : Swift_Signers_DKIMSigner
$time integer A timestamp
Résultat Swift_Signers_DKIMSigner

setSignerIdentity() public méthode

Set the signer identity.
public setSignerIdentity ( string $identity ) : Swift_Signers_DKIMSigner
$identity string
Résultat Swift_Signers_DKIMSigner

startBody() public méthode

Start Body.
public startBody ( )

unbind() public méthode

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 )
$is Swift_InputByteStream

write() public méthode

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 ) : integer
$bytes string
Résultat integer

Property Details

$bodyCanon protected_oe property

Body canon method.
protected string $bodyCanon
Résultat string

$bodyLen protected_oe property

BodyLength.
protected int $bodyLen
Résultat integer

$debugHeaders protected_oe property

Must we embed signed headers?
protected bool $debugHeaders
Résultat boolean

$dkimHeader protected_oe property

Stores the signature header.
protected Swift_Mime_Headers_ParameterizedHeader $dkimHeader
Résultat Swift_Mime_Headers_ParameterizedHeader

$domainName protected_oe property

DomainName.
protected string $domainName
Résultat string

$hashAlgorithm protected_oe property

Hash algorithm used.
protected string $hashAlgorithm
Résultat string

$headerCanon protected_oe property

Header canon method.
protected string $headerCanon
Résultat string

$ignoredHeaders protected_oe property

Headers not being signed.
protected array $ignoredHeaders
Résultat array

$maxLen protected_oe property

Maximum signedLen.
protected int $maxLen
Résultat integer

$privateKey protected_oe property

PrivateKey.
protected string $privateKey
Résultat string

$selector protected_oe property

Selector.
protected string $selector
Résultat string

$showLen protected_oe property

Embbed bodyLen in signature.
protected bool $showLen
Résultat boolean

$signatureExpiration protected_oe property

When will the signature expires false means not embedded, if sigTimestamp is auto Expiration is relative, otherwhise it's absolute.
protected int $signatureExpiration
Résultat integer

$signatureTimestamp protected_oe property

When the signature has been applied (true means time()), false means not embedded.
protected mixed $signatureTimestamp
Résultat mixed

$signedHeaders protected_oe property

Headers used to generate hash.
protected array $signedHeaders
Résultat array

$signerIdentity protected_oe property

Signer identity.
protected string $signerIdentity
Résultat string