PHP Class Swift_Signers_SMimeSigner, Halite

Author: Romain-Geissler
Author: Sebastiaan Stok ([email protected])
Inheritance: implements Swift_Signers_BodySigner
Afficher le fichier Open project: HaliteChallenge/Halite Class Usage Examples

Protected Properties

Свойство Type Description
$encryptCert
$encryptCipher
$encryptLevel
$encryptOptions
$extraCerts
$headerFactory Swift_Mime_HeaderFactory
$replacementFactory Swift_StreamFilters_StringReplacementFilterFactory
$signCertificate
$signLevel
$signOptions
$signPrivateKey
$signThenEncrypt

Méthodes publiques

Méthode Description
__construct ( string | null $signCertificate = null, string | null $signPrivateKey = null, string | null $encryptCertificate = null ) Constructor.
getAlteredHeaders ( ) : array Return the list of header a signer might tamper.
getSignCertificate ( ) : string
getSignPrivateKey ( ) : string
isSignThenEncrypt ( ) : boolean
newInstance ( string $certificate = null, string $privateKey = null ) : Swift_Signers_SMimeSigner Returns an new Swift_Signers_SMimeSigner instance.
reset ( ) : Swift_Signers_SMimeSigner Resets internal states.
setEncryptCertificate ( string | array $recipientCerts, integer $cipher = null ) : Swift_Signers_SMimeSigner Set the certificate location to use for encryption.
setSignCertificate ( string $certificate, string | array $privateKey = null, integer $signOptions = PKCS7_DETACHED, string $extraCerts = null ) : Swift_Signers_SMimeSigner Set the certificate location to use for signing.
setSignThenEncrypt ( boolean $signThenEncrypt = true ) : Swift_Signers_SMimeSigner Set perform signing before encryption.
signMessage ( Swift_Message $message ) : Swift_Signers_SMimeSigner Change the Swift_Message to apply the signing.

Méthodes protégées

Méthode Description
copyFromOpenSSLOutput ( Swift_OutputByteStream $fromStream, Swift_InputByteStream $toStream )
createMessage ( Swift_Message $message ) : Swift_Message
messageStreamToEncryptedByteStream ( Swift_FileStream $outputStream, Swift_InputByteStream $is )
messageStreamToSignedByteStream ( Swift_FileStream $outputStream, Swift_InputByteStream $inputStream )
streamToMime ( Swift_OutputByteStream $fromStream, Swift_Message $message ) Merges an OutputByteStream to Swift_Message.
toSMimeByteStream ( Swift_InputByteStream $inputStream, Swift_Message $message )

Method Details

__construct() public méthode

Constructor.
public __construct ( string | null $signCertificate = null, string | null $signPrivateKey = null, string | null $encryptCertificate = null )
$signCertificate string | null
$signPrivateKey string | null
$encryptCertificate string | null

copyFromOpenSSLOutput() protected méthode

protected copyFromOpenSSLOutput ( Swift_OutputByteStream $fromStream, Swift_InputByteStream $toStream )
$fromStream Swift_OutputByteStream
$toStream Swift_InputByteStream

createMessage() protected méthode

protected createMessage ( Swift_Message $message ) : Swift_Message
$message Swift_Message
Résultat Swift_Message

getAlteredHeaders() public méthode

Return the list of header a signer might tamper.
public getAlteredHeaders ( ) : array
Résultat array

getSignCertificate() public méthode

public getSignCertificate ( ) : string
Résultat string

getSignPrivateKey() public méthode

public getSignPrivateKey ( ) : string
Résultat string

isSignThenEncrypt() public méthode

public isSignThenEncrypt ( ) : boolean
Résultat boolean

messageStreamToEncryptedByteStream() protected méthode

protected messageStreamToEncryptedByteStream ( Swift_FileStream $outputStream, Swift_InputByteStream $is )
$outputStream Swift_FileStream
$is Swift_InputByteStream

messageStreamToSignedByteStream() protected méthode

protected messageStreamToSignedByteStream ( Swift_FileStream $outputStream, Swift_InputByteStream $inputStream )
$outputStream Swift_FileStream
$inputStream Swift_InputByteStream

newInstance() public static méthode

Returns an new Swift_Signers_SMimeSigner instance.
public static newInstance ( string $certificate = null, string $privateKey = null ) : Swift_Signers_SMimeSigner
$certificate string
$privateKey string
Résultat Swift_Signers_SMimeSigner

reset() public méthode

Resets internal states.
public reset ( ) : Swift_Signers_SMimeSigner
Résultat Swift_Signers_SMimeSigner

setEncryptCertificate() public méthode

Set the certificate location to use for encryption.
public setEncryptCertificate ( string | array $recipientCerts, integer $cipher = null ) : Swift_Signers_SMimeSigner
$recipientCerts string | array Either an single X.509 certificate, or an assoc array of X.509 certificates.
$cipher integer
Résultat Swift_Signers_SMimeSigner

setSignCertificate() public méthode

Set the certificate location to use for signing.
public setSignCertificate ( string $certificate, string | array $privateKey = null, integer $signOptions = PKCS7_DETACHED, string $extraCerts = null ) : Swift_Signers_SMimeSigner
$certificate string
$privateKey string | array If the key needs an passphrase use array('file-location', 'passphrase') instead
$signOptions integer Bitwise operator options for openssl_pkcs7_sign()
$extraCerts string A file containing intermediate certificates needed by the signing certificate
Résultat Swift_Signers_SMimeSigner

setSignThenEncrypt() public méthode

The default is to first sign the message and then encrypt. But some older mail clients, namely Microsoft Outlook 2000 will work when the message first encrypted. As this goes against the official specs, its recommended to only use 'encryption -> signing' when specifically targeting these 'broken' clients.
public setSignThenEncrypt ( boolean $signThenEncrypt = true ) : Swift_Signers_SMimeSigner
$signThenEncrypt boolean
Résultat Swift_Signers_SMimeSigner

signMessage() public méthode

Change the Swift_Message to apply the signing.
public signMessage ( Swift_Message $message ) : Swift_Signers_SMimeSigner
$message Swift_Message
Résultat Swift_Signers_SMimeSigner

streamToMime() protected méthode

Merges an OutputByteStream to Swift_Message.
protected streamToMime ( Swift_OutputByteStream $fromStream, Swift_Message $message )
$fromStream Swift_OutputByteStream
$message Swift_Message

toSMimeByteStream() protected méthode

protected toSMimeByteStream ( Swift_InputByteStream $inputStream, Swift_Message $message )
$inputStream Swift_InputByteStream
$message Swift_Message

Property Details

$encryptCert protected_oe property

protected $encryptCert

$encryptCipher protected_oe property

protected $encryptCipher

$encryptLevel protected_oe property

protected $encryptLevel

$encryptOptions protected_oe property

protected $encryptOptions

$extraCerts protected_oe property

protected $extraCerts

$headerFactory protected_oe property

protected Swift_Mime_HeaderFactory $headerFactory
Résultat Swift_Mime_HeaderFactory

$replacementFactory protected_oe property

protected Swift_StreamFilters_StringReplacementFilterFactory $replacementFactory
Résultat Swift_StreamFilters_StringReplacementFilterFactory

$signCertificate protected_oe property

protected $signCertificate

$signLevel protected_oe property

protected $signLevel

$signOptions protected_oe property

protected $signOptions

$signPrivateKey protected_oe property

protected $signPrivateKey

$signThenEncrypt protected_oe property

protected $signThenEncrypt