Documentation

Swift_Signers_OpenDKIMSigner extends Swift_Signers_DKIMSigner
in package

DKIM Signer used to apply DKIM Signature to a message Takes advantage of pecl extension.

Tags
author

Xavier De Cock xdecock@gmail.com

deprecated

since SwiftMailer 6.1.0; use Swift_Signers_DKIMSigner instead.

Table of Contents

CANON_RELAXED  = 1
CANON_SIMPLE  = 2
SIG_RSA_SHA1  = 3
SIG_RSA_SHA256  = 4
$bodyCanon  : string
Body canon method.
$bodyLen  : int
BodyLength.
$debugHeaders  : bool
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<string|int, mixed>
Headers not being signed.
$maxLen  : int
Maximum signedLen.
$privateKey  : string
PrivateKey.
$selector  : string
Selector.
$showLen  : bool
Embbed bodyLen in signature.
$signatureExpiration  : int
When will the signature expires false means not embedded, if sigTimestamp is auto Expiration is relative, otherwise it's absolute.
$signatureTimestamp  : mixed
When the signature has been applied (true means time()), false means not embedded.
$signedHeaders  : array<string|int, mixed>
Headers used to generate hash.
$signerIdentity  : string
Signer identity.
$bodyCanonEmptyCounter  : mixed
$bodyCanonIgnoreStart  : mixed
$bodyCanonLastChar  : mixed
$bodyCanonLine  : mixed
$bodyCanonSpace  : mixed
$bodyHash  : string
Stores the bodyHash.
$bodyHashHandler  : mixed
$bound  : mixed
$debugHeadersData  : array<string|int, string>
If debugHeaders is set store debugData here.
$dkimHandler  : mixed
$dropFirstLF  : mixed
$headerCanonData  : mixed
$headerHash  : mixed
$passphrase  : mixed
$peclLoaded  : mixed
__construct()  : mixed
Constructor.
addSignature()  : Swift_Signers_DKIMSigner
Add the signature to the given Headers.
bind()  : mixed
Attach $is to this stream.
commit()  : mixed
For any bytes that are currently buffered inside the stream, force them off the buffer.
endBody()  : self
End Body.
flushBuffers()  : mixed
Flush the contents of the stream (empty it) and set the internal pointer to the beginning.
getAlteredHeaders()  : array<string|int, mixed>
Returns the list of Headers Tampered by this plugin.
ignoreHeader()  : Swift_Signers_DKIMSigner
Adds an ignored Header.
reset()  : mixed
Reset the Signer.
setBodyCanon()  : $this
Set the body canonicalization algorithm.
setBodySignedLen()  : $this
Set the length of the body to sign.
setDebugHeaders()  : $this
Enable / disable the DebugHeaders.
setHashAlgorithm()  : $this
Set hash_algorithm, must be one of rsa-sha256 | rsa-sha1.
setHeaderCanon()  : $this
Set the header canonicalization algorithm.
setHeaders()  : Swift_Signers_DKIMSigner
Set the headers to sign.
setSignatureExpiration()  : $this
Set the signature expiration timestamp.
setSignatureTimestamp()  : $this
Set the signature timestamp.
setSignerIdentity()  : $this
Set the signer identity.
startBody()  : self
Start Body.
unbind()  : mixed
Remove an already bound stream.
write()  : int
Writes $bytes to the end of the stream.
addHeader()  : mixed
canonicalizeBody()  : mixed
endOfBody()  : mixed
addToBodyHash()  : mixed
addToHeaderHash()  : mixed
getEncryptedHash()  : string

Constants

Properties

$bodyCanon

Body canon method.

protected string $bodyCanon = 'simple'

$debugHeaders

Must we embed signed headers?

protected bool $debugHeaders = alse

$domainName

DomainName.

protected string $domainName

$hashAlgorithm

Hash algorithm used.

protected string $hashAlgorithm = 'rsa-sha256'
Tags
see
RFC6376

3.3: Signers MUST implement and SHOULD sign using rsa-sha256.

$headerCanon

Header canon method.

protected string $headerCanon = 'simple'

$ignoredHeaders

Headers not being signed.

protected array<string|int, mixed> $ignoredHeaders = ['return-path' => rue]

$maxLen

Maximum signedLen.

protected int $maxLen = PHP_INT_MAX

$privateKey

PrivateKey.

protected string $privateKey

$showLen

Embbed bodyLen in signature.

protected bool $showLen = alse

$signatureExpiration

When will the signature expires false means not embedded, if sigTimestamp is auto Expiration is relative, otherwise it's absolute.

protected int $signatureExpiration = alse

$signatureTimestamp

When the signature has been applied (true means time()), false means not embedded.

protected mixed $signatureTimestamp = rue

$signedHeaders

Headers used to generate hash.

protected array<string|int, mixed> $signedHeaders = []

$signerIdentity

Signer identity.

protected string $signerIdentity

$bodyCanonEmptyCounter

private mixed $bodyCanonEmptyCounter = 0

$bodyCanonIgnoreStart

private mixed $bodyCanonIgnoreStart = 2

$bodyCanonLastChar

private mixed $bodyCanonLastChar = ull

$bodyCanonLine

private mixed $bodyCanonLine = ''

$bodyCanonSpace

private mixed $bodyCanonSpace = alse

$bodyHash

Stores the bodyHash.

private string $bodyHash = ''

$bodyHashHandler

private mixed $bodyHashHandler

$debugHeadersData

If debugHeaders is set store debugData here.

private array<string|int, string> $debugHeadersData = []

$headerCanonData

private mixed $headerCanonData = ''

Methods

__construct()

Constructor.

public __construct(mixed $privateKey, mixed $domainName, mixed $selector) : mixed
Parameters
$privateKey : mixed
$domainName : mixed
$selector : mixed
Return values
mixed

commit()

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

public commit() : mixed
Return values
mixed

endBody()

End Body.

public endBody() : self
Return values
self

flushBuffers()

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

public flushBuffers() : mixed
Tags
throws
Swift_IoException
Return values
mixed

getAlteredHeaders()

Returns the list of Headers Tampered by this plugin.

public getAlteredHeaders() : array<string|int, mixed>
Return values
array<string|int, mixed>

reset()

Reset the Signer.

public reset() : mixed
Return values
mixed

setBodyCanon()

Set the body canonicalization algorithm.

public setBodyCanon(string $canon) : $this
Parameters
$canon : string
Return values
$this

setBodySignedLen()

Set the length of the body to sign.

public setBodySignedLen(mixed $len) : $this
Parameters
$len : mixed

(bool or int)

Return values
$this

setDebugHeaders()

Enable / disable the DebugHeaders.

public setDebugHeaders(bool $debug) : $this
Parameters
$debug : bool
Return values
$this

setHashAlgorithm()

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

public setHashAlgorithm(string $hash) : $this
Parameters
$hash : string

'rsa-sha1' or 'rsa-sha256'

Tags
throws
Swift_SwiftException
Return values
$this

setHeaderCanon()

Set the header canonicalization algorithm.

public setHeaderCanon(string $canon) : $this
Parameters
$canon : string
Return values
$this

setSignatureExpiration()

Set the signature expiration timestamp.

public setSignatureExpiration(int $time) : $this
Parameters
$time : int
Return values
$this

setSignatureTimestamp()

Set the signature timestamp.

public setSignatureTimestamp(int $time) : $this
Parameters
$time : int
Return values
$this

setSignerIdentity()

Set the signer identity.

public setSignerIdentity(string $identity) : $this
Parameters
$identity : string
Return values
$this

startBody()

Start Body.

public startBody() : self
Return values
self

unbind()

Remove an already bound stream.

public unbind(Swift_InputByteStream $is) : mixed

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
$is : Swift_InputByteStream
Return values
mixed

write()

Writes $bytes to the end of the stream.

public write(string $bytes) : int

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

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

Parameters
$bytes : string
Tags
throws
Swift_IoException
Return values
int

addHeader()

protected addHeader(mixed $header[, mixed $is_sig = false ]) : mixed
Parameters
$header : mixed
$is_sig : mixed = false
Return values
mixed

canonicalizeBody()

protected canonicalizeBody(mixed $string) : mixed
Parameters
$string : mixed
Return values
mixed

endOfBody()

protected endOfBody() : mixed
Return values
mixed

addToBodyHash()

private addToBodyHash(mixed $string) : mixed
Parameters
$string : mixed
Return values
mixed

addToHeaderHash()

private addToHeaderHash(mixed $header) : mixed
Parameters
$header : mixed
Return values
mixed

Search results