lib/classes/Swift/Signers/SMimeSigner.php
public function setSignCertificate($certificate, $privateKey = null, $signOptions = PKCS7_DETACHED, $extraCerts = null)
    {
        $this->signCertificate = 'file://'.str_replace('\\', '/', realpath($certificate));

        if (null !== $privateKey) {
            if (is_array($privateKey)) {
                $this->signPrivateKey = $privateKey;
                $this->signPrivateKey[0] = 'file://'.str_replace('\\', '/', realpath($privateKey[0]));
            } else {
                $this->signPrivateKey = 'file://'.str_replace('\\', '/', realpath($privateKey));
            }
        }

        $this->signOptions = $signOptions;
        $this->extraCerts = $extraCerts ? realpath($extraCerts) : null;

        return $this;
    }
public function setSignCertificate($certificate, $privateKey = null, $signOptions = PKCS7_DETACHED, $extraCerts = null)
    {
        $this->signCertificate = 'file://'.str_replace('\\', '/', realpath($certificate));

        if (null !== $privateKey) {
            if (is_array($privateKey)) {
                $this->signPrivateKey = $privateKey;
                $this->signPrivateKey[0] = 'file://'.str_replace('\\', '/', realpath($privateKey[0]));
            } else {
                $this->signPrivateKey = 'file://'.str_replace('\\', '/', realpath($privateKey));
            }
        }

        $this->signOptions = $signOptions;
        $this->extraCerts = $extraCerts ? realpath($extraCerts) : null;

        return $this;
    }
public function setSignCertificate ( $ certificate , $ privateKey = null , $ signOptions = PKCS7_DETACHED , $ extraCerts = null ) { $ this -> signCertificate = 'file://' . str_replace ( '\\' , '/' , realpath ( $ certificate ) ) ; if ( null !== $ privateKey ) { if ( is_array ( $ privateKey ) ) { $ this -> signPrivateKey = $ privateKey ; $ this -> signPrivateKey [ 0 ] = 'file://' . str_replace ( '\\' , '/' , realpath ( $ privateKey [ 0 ] ) ) ; } else { $ this -> signPrivateKey = 'file://' . str_replace ( '\\' , '/' , realpath ( $ privateKey ) ) ; } } $ this -> signOptions = $ signOptions ; $ this -> extraCerts = $ extraCerts ? realpath ( $ extraCerts ) : null ; return $ this ; }
Set the certificate location to use for signing.

@see https://secure.php.net/manual/en/openssl.pkcs7.flags.php

@param string       $certificate
@param string|array $privateKey  If the key needs an passphrase use array('file-location', 'passphrase') instead
@param int          $signOptions Bitwise operator options for openssl_pkcs7_sign()
@param string       $extraCerts  A file containing intermediate certificates needed by the signing certificate

@return $this
Set the certificate location to use for signing .