TYPO3  7.6
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Swift_Signers_SMimeSigner Class Reference
Inheritance diagram for Swift_Signers_SMimeSigner:
Swift_Signers_BodySigner Swift_Signer

Public Member Functions

 __construct ($signCertificate=null, $signPrivateKey=null, $encryptCertificate=null)
 
 setSignCertificate ($certificate, $privateKey=null, $signOptions=PKCS7_DETACHED, $extraCerts=null)
 
 setEncryptCertificate ($recipientCerts, $cipher=null)
 
 getSignCertificate ()
 
 getSignPrivateKey ()
 
 setSignThenEncrypt ($signThenEncrypt=true)
 
 isSignThenEncrypt ()
 
 reset ()
 
 signMessage (Swift_Message $message)
 
 getAlteredHeaders ()
 

Static Public Member Functions

static newInstance ($certificate=null, $privateKey=null)
 

Protected Member Functions

 toSMimeByteStream (Swift_InputByteStream $inputStream, Swift_Message $message)
 
 createMessage (Swift_Message $message)
 
 messageStreamToSignedByteStream (Swift_FileStream $outputStream, Swift_InputByteStream $inputStream)
 
 messageStreamToEncryptedByteStream (Swift_FileStream $outputStream, Swift_InputByteStream $is)
 
 copyFromOpenSSLOutput (Swift_OutputByteStream $fromStream, Swift_InputByteStream $toStream)
 
 streamToMime (Swift_OutputByteStream $fromStream, Swift_Message $message)
 

Protected Attributes

 $signCertificate
 
 $signPrivateKey
 
 $encryptCert
 
 $signThenEncrypt = true
 
 $signLevel
 
 $encryptLevel
 
 $signOptions
 
 $encryptOptions
 
 $encryptCipher
 
 $extraCerts = null
 
 $replacementFactory
 
 $headerFactory
 

Detailed Description

MIME Message Signer used to apply S/MIME Signature/Encryption to a message.

Author
Romain-Geissler
Sebastiaan Stok s.sto.nosp@m.k@ro.nosp@m.llers.nosp@m.cape.nosp@m.s.net

Definition at line 18 of file SMimeSigner.php.

Constructor & Destructor Documentation

__construct (   $signCertificate = null,
  $signPrivateKey = null,
  $encryptCertificate = null 
)

Constructor.

Parameters
string$certificate
string$privateKey
string$encryptCertificate

Definition at line 48 of file SMimeSigner.php.

References $signCertificate, $signPrivateKey, Swift_DependencyContainer\getInstance(), setEncryptCertificate(), and setSignCertificate().

Member Function Documentation

copyFromOpenSSLOutput ( Swift_OutputByteStream  $fromStream,
Swift_InputByteStream  $toStream 
)
protected
createMessage ( Swift_Message  $message)
protected
getAlteredHeaders ( )

Return the list of header a signer might tamper.

Returns
array

Implements Swift_Signers_BodySigner.

Definition at line 230 of file SMimeSigner.php.

getSignCertificate ( )
Returns
string

Definition at line 150 of file SMimeSigner.php.

References $signCertificate.

getSignPrivateKey ( )
Returns
string

Definition at line 158 of file SMimeSigner.php.

References $signPrivateKey.

isSignThenEncrypt ( )
Returns
bool

Definition at line 184 of file SMimeSigner.php.

References $signThenEncrypt.

messageStreamToEncryptedByteStream ( Swift_FileStream  $outputStream,
Swift_InputByteStream  $is 
)
protected
Parameters
Swift_FileStream$outputStream
Swift_InputByteStream$is
Exceptions
Swift_IoException

Definition at line 313 of file SMimeSigner.php.

References $encryptCert, $encryptCipher, copyFromOpenSSLOutput(), and Swift_FileStream\getPath().

Referenced by toSMimeByteStream().

messageStreamToSignedByteStream ( Swift_FileStream  $outputStream,
Swift_InputByteStream  $inputStream 
)
protected
static newInstance (   $certificate = null,
  $privateKey = null 
)
static

Returns an new Swift_Signers_SMimeSigner instance.

Parameters
string$certificate
string$privateKey
Returns
Swift_Signers_SMimeSigner

Definition at line 79 of file SMimeSigner.php.

reset ( )

Resets internal states.

Returns
Swift_Signers_SMimeSigner

Implements Swift_Signer.

Definition at line 194 of file SMimeSigner.php.

setEncryptCertificate (   $recipientCerts,
  $cipher = null 
)

Set the certificate location to use for encryption.

http://nl3.php.net/manual/en/openssl.ciphers.php string|array $recipientCerts Either an single X.509 certificate, or an assoc array of X.509 certificates. int $cipher Swift_Signers_SMimeSigner

Definition at line 128 of file SMimeSigner.php.

Referenced by __construct().

setSignCertificate (   $certificate,
  $privateKey = null,
  $signOptions = PKCS7_DETACHED,
  $extraCerts = null 
)
setSignThenEncrypt (   $signThenEncrypt = true)

Set perform signing before encryption.

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.

Parameters
string$signThenEncrypt
Returns
Swift_Signers_SMimeSigner

Definition at line 174 of file SMimeSigner.php.

References $signThenEncrypt.

signMessage ( Swift_Message  $message)
streamToMime ( Swift_OutputByteStream  $fromStream,
Swift_Message  $message 
)
protected
toSMimeByteStream ( Swift_InputByteStream  $inputStream,
Swift_Message  $message 
)
protected
Parameters
Swift_InputByteStream$inputStream
Swift_Message$mimeEntity

Definition at line 239 of file SMimeSigner.php.

References createMessage(), elseif, messageStreamToEncryptedByteStream(), and messageStreamToSignedByteStream().

Referenced by signMessage().

Member Data Documentation

$encryptCert
protected

Definition at line 22 of file SMimeSigner.php.

Referenced by messageStreamToEncryptedByteStream().

$encryptCipher
protected

Definition at line 28 of file SMimeSigner.php.

Referenced by messageStreamToEncryptedByteStream().

$encryptLevel
protected

Definition at line 25 of file SMimeSigner.php.

$encryptOptions
protected

Definition at line 27 of file SMimeSigner.php.

$extraCerts = null
protected

Definition at line 29 of file SMimeSigner.php.

Referenced by messageStreamToSignedByteStream(), and setSignCertificate().

$headerFactory
protected

Definition at line 39 of file SMimeSigner.php.

$replacementFactory
protected

Definition at line 34 of file SMimeSigner.php.

$signCertificate
protected
$signLevel
protected

Definition at line 24 of file SMimeSigner.php.

$signOptions
protected

Definition at line 26 of file SMimeSigner.php.

Referenced by messageStreamToSignedByteStream(), and setSignCertificate().

$signPrivateKey
protected

Definition at line 21 of file SMimeSigner.php.

Referenced by __construct(), getSignPrivateKey(), and messageStreamToSignedByteStream().

$signThenEncrypt = true
protected

Definition at line 23 of file SMimeSigner.php.

Referenced by isSignThenEncrypt(), and setSignThenEncrypt().