Swift_Signers_DomainKeySigner
in package
implements
Swift_Signers_HeaderSigner
DomainKey Signer used to apply DomainKeys Signature to a message.
Tags
Interfaces, Classes and Traits
- Swift_Signers_HeaderSigner
- Header Signer Interface used to apply Header-Based Signature to a message.
Table of Contents
- $canon : string
- Canonisation method.
- $debugHeaders : bool
- Must we embed signed headers?
- $domainKeyHeader : Swift_Mime_Headers_ParameterizedHeader
- Stores the signature header.
- $domainName : string
- DomainName.
- $hashAlgorithm : string
- Hash algorithm used.
- $ignoredHeaders : array<string|int, mixed>
- Headers not being signed.
- $privateKey : string
- PrivateKey.
- $selector : string
- Selector.
- $signerIdentity : string
- Signer identity.
- $bodyCanonEmptyCounter : mixed
- $bodyCanonIgnoreStart : mixed
- $bodyCanonLastChar : mixed
- $bodyCanonLine : mixed
- $bodyCanonSpace : mixed
- $bound : mixed
- $canonData : mixed
- $hashHandler : resource|null
- Hash Handler.
- $signedHeaders : array<string|int, mixed>
- Headers used to generate hash.
- __construct() : mixed
- Constructor.
- addSignature() : $this
- Add the signature to the given Headers.
- bind() : $this
- Attach $is to this stream.
- commit() : $this
- For any bytes that are currently buffered inside the stream, force them off the buffer.
- endBody() : self
- End Body.
- flushBuffers() : $this
- 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() : $this
- Adds an ignored Header.
- reset() : $this
- Resets internal states.
- setCanon() : $this
- Set the canonicalization algorithm.
- setDebugHeaders() : $this
- Enable / disable the DebugHeaders.
- setHashAlgorithm() : $this
- Set hash_algorithm, must be one of rsa-sha256 | rsa-sha1 defaults to rsa-sha256.
- setHeaders() : $this
- Set the headers to sign.
- setSignerIdentity() : $this
- Set the signer identity.
- startBody() : self
- Start Body.
- unbind() : $this
- Remove an already bound stream.
- write() : int
- Writes $bytes to the end of the stream.
- addHeader() : mixed
- canonicalizeBody() : mixed
- endOfBody() : mixed
- endOfHeaders() : mixed
- addToHash() : mixed
- getEncryptedHash() : string
- startHash() : mixed
Properties
$canon
Canonisation method.
protected
string
$canon
= 'simple'
$debugHeaders
Must we embed signed headers?
protected
bool
$debugHeaders
= alse
$domainKeyHeader
Stores the signature header.
protected
Swift_Mime_Headers_ParameterizedHeader
$domainKeyHeader
$domainName
DomainName.
protected
string
$domainName
$hashAlgorithm
Hash algorithm used.
protected
string
$hashAlgorithm
= 'rsa-sha1'
$ignoredHeaders
Headers not being signed.
protected
array<string|int, mixed>
$ignoredHeaders
= []
$privateKey
PrivateKey.
protected
string
$privateKey
$selector
Selector.
protected
string
$selector
$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
$bound
private
mixed
$bound
= []
$canonData
private
mixed
$canonData
= ''
$hashHandler
Hash Handler.
private
resource|null
$hashHandler
$signedHeaders
Headers used to generate hash.
private
array<string|int, mixed>
$signedHeaders
= []
Methods
__construct()
Constructor.
public
__construct(string $privateKey, string $domainName, string $selector) : mixed
Parameters
- $privateKey : string
- $domainName : string
- $selector : string
Return values
mixed —addSignature()
Add the signature to the given Headers.
public
addSignature(Swift_Mime_SimpleHeaderSet $headers) : $this
Parameters
- $headers : Swift_Mime_SimpleHeaderSet
Return values
$this —bind()
Attach $is to this stream.
public
bind(Swift_InputByteStream $is) : $this
The stream acts as an observer, receiving all data that is written. All and operations will be mirrored.
Parameters
- $is : Swift_InputByteStream
Return values
$this —commit()
For any bytes that are currently buffered inside the stream, force them off the buffer.
public
commit() : $this
Tags
Return values
$this —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() : $this
Tags
Return values
$this —getAlteredHeaders()
Returns the list of Headers Tampered by this plugin.
public
getAlteredHeaders() : array<string|int, mixed>
Return values
array<string|int, mixed> —ignoreHeader()
Adds an ignored Header.
public
ignoreHeader(string $header_name) : $this
Parameters
- $header_name : string
Return values
$this —reset()
Resets internal states.
public
reset() : $this
Return values
$this —setCanon()
Set the canonicalization algorithm.
public
setCanon(string $canon) : $this
Parameters
- $canon : string
-
simple | nofws defaults to simple
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 defaults to rsa-sha256.
public
setHashAlgorithm(string $hash) : $this
Parameters
- $hash : string
Return values
$this —setHeaders()
Set the headers to sign.
public
setHeaders(Swift_Mime_SimpleHeaderSet $headers) : $this
Parameters
- $headers : Swift_Mime_SimpleHeaderSet
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) : $this
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
$this —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
Return values
int —addHeader()
protected
addHeader(mixed $header) : mixed
Parameters
- $header : mixed
Return values
mixed —canonicalizeBody()
protected
canonicalizeBody(mixed $string) : mixed
Parameters
- $string : mixed
Return values
mixed —endOfBody()
protected
endOfBody() : mixed
Return values
mixed —endOfHeaders()
protected
endOfHeaders() : mixed
Return values
mixed —addToHash()
private
addToHash(mixed $string) : mixed
Parameters
- $string : mixed
Return values
mixed —getEncryptedHash()
private
getEncryptedHash() : string
Tags
Return values
string —startHash()
private
startHash() : mixed