Class Swift_Signers_SMimeSigner
Inheritance | Swift_Signers_SMimeSigner |
---|---|
Implements | Swift_Signers_BodySigner |
MIME Message Signer used to apply S/MIME Signature/Encryption to a message.
Protected Properties
Public Methods
Method | Description | Defined By |
---|---|---|
__construct() | Constructor. | Swift_Signers_SMimeSigner |
getAlteredHeaders() | Return the list of header a signer might tamper. | Swift_Signers_SMimeSigner |
getSignCertificate() | Swift_Signers_SMimeSigner | |
getSignPrivateKey() | Swift_Signers_SMimeSigner | |
isSignThenEncrypt() | Swift_Signers_SMimeSigner | |
newInstance() | Returns an new Swift_Signers_SMimeSigner instance. | Swift_Signers_SMimeSigner |
reset() | Resets internal states. | Swift_Signers_SMimeSigner |
setEncryptCertificate() | Set the certificate location to use for encryption. | Swift_Signers_SMimeSigner |
setSignCertificate() | Set the certificate location to use for signing. | Swift_Signers_SMimeSigner |
setSignThenEncrypt() | Set perform signing before encryption. | Swift_Signers_SMimeSigner |
signMessage() | Change the Swift_Message to apply the signing. | Swift_Signers_SMimeSigner |
Protected Methods
Method | Description | Defined By |
---|---|---|
copyFromOpenSSLOutput() | Swift_Signers_SMimeSigner | |
createMessage() | Swift_Signers_SMimeSigner | |
messageStreamToEncryptedByteStream() | Swift_Signers_SMimeSigner | |
messageStreamToSignedByteStream() | Swift_Signers_SMimeSigner | |
streamToMime() | Merges an OutputByteStream to Swift_Message. | Swift_Signers_SMimeSigner |
toSMimeByteStream() | Swift_Signers_SMimeSigner |
Property Details
Method Details
Constructor.
public void __construct ( $signCertificate = null, $signPrivateKey = null, $encryptCertificate = null ) | ||
$signCertificate | ||
$signPrivateKey | ||
$encryptCertificate | string |
protected void copyFromOpenSSLOutput ( Swift_OutputByteStream $fromStream, Swift_InputByteStream $toStream ) | ||
$fromStream | Swift_OutputByteStream | |
$toStream | Swift_InputByteStream |
protected Swift_Message createMessage ( Swift_Message $message ) | ||
$message | Swift_Message |
Return the list of header a signer might tamper.
public array getAlteredHeaders ( ) |
public string getSignCertificate ( ) |
public string getSignPrivateKey ( ) |
public bool isSignThenEncrypt ( ) |
protected void messageStreamToEncryptedByteStream ( Swift_FileStream $outputStream, Swift_InputByteStream $is ) | ||
$outputStream | Swift_FileStream | |
$is | Swift_InputByteStream | |
throws | Swift_IoException |
---|
protected void messageStreamToSignedByteStream ( Swift_FileStream $outputStream, Swift_InputByteStream $inputStream ) | ||
$outputStream | Swift_FileStream | |
$inputStream | Swift_InputByteStream | |
throws | Swift_IoException |
---|
Returns an new Swift_Signers_SMimeSigner instance.
public static Swift_Signers_SMimeSigner newInstance ( $certificate = null, $privateKey = null ) | ||
$certificate | string | |
$privateKey | string |
Resets internal states.
public Swift_Signers_SMimeSigner reset ( ) |
Set the certificate location to use for encryption.
public Swift_Signers_SMimeSigner setEncryptCertificate ( $recipientCerts, $cipher = null ) | ||
$recipientCerts | string|array | Either an single X.509 certificate, or an assoc array of X.509 certificates. |
$cipher | int |
Set the certificate location to use for signing.
public Swift_Signers_SMimeSigner setSignCertificate ( $certificate, $privateKey = null, $signOptions = PKCS7_DETACHED, $extraCerts = null ) | ||
$certificate | string | |
$privateKey | string|array | If the key needs an passphrase use array('file-location', 'passphrase') instead |
$signOptions | int | Bitwise operator options for openssl_pkcs7_sign() |
$extraCerts | string | A file containing intermediate certificates needed by the signing certificate |
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.
public Swift_Signers_SMimeSigner setSignThenEncrypt ( $signThenEncrypt = true ) | ||
$signThenEncrypt | string |
Change the Swift_Message to apply the signing.
public Swift_Signers_SMimeSigner signMessage ( Swift_Message $message ) | ||
$message | Swift_Message |
Merges an OutputByteStream to Swift_Message.
protected void streamToMime ( Swift_OutputByteStream $fromStream, Swift_Message $message ) | ||
$fromStream | Swift_OutputByteStream | |
$message | Swift_Message |
protected void toSMimeByteStream ( Swift_InputByteStream $inputStream, Swift_Message $message ) | ||
$inputStream | Swift_InputByteStream | |
$message |