SetaPDF_Signer_Signature_Module_OpenSslCliCms A signature module which uses the CMS utility of OpenSSL via command line.

File: /SetaPDF/Signer/Signature/Module/OpenSslCliCms.php

The CMS utility is described here: http://www.openssl.org/docs/apps/cms.html.

Class hierarchy

Implements

Summary

Properties

$_certificate

The path to the signing certificate

$_digest

The digest algorithm to use when signing

$_extraCertificates

The path to the extra/other certificates

$_openSslPath

A path to additional certificates to be specified

$_outPath

A temporary path of the signed message

$_privateKey

The path to the private key to use when signing


Methods

_cleanUp()

protected void SetaPDF_Signer_Signature_Module_OpenSslCli::_cleanUp ( void )

Removes temporary file if needed.

_getUtility()

protected string SetaPDF_Signer_Signature_Module_OpenSslCliCms::_getUtility ( void )

Returns the name of the OpenSSL utitlity.

createSignature()

public string SetaPDF_Signer_Signature_Module_OpenSslCli::createSignature ( SetaPDF_Core_Reader_FilePath $tmpPath )

Create the signature.

This method creates a digital signature for the file available in $tmpPath and returns it in binary format.

Parameters
$tmpPath : SetaPDF_Core_Reader_FilePath
 
Exceptions

Throws SetaPDF_Signer_Exception, InvalidArgumentException

getCertificate()

public string SetaPDF_Signer_Signature_Module_OpenSslCli::getCertificate ( void )

Get the path to the signing certificate.

getDigest()

public string SetaPDF_Signer_Signature_Module_OpenSslCli::getDigest ( void )

Get the digest algorithm.

getExtraCertificates()

public string SetaPDF_Signer_Signature_Module_OpenSslCli::getExtraCertificates ( void )

Get the path of the file with additional certificates.

getOpenSslPath()

public string SetaPDF_Signer_Signature_Module_OpenSslCli::getOpenSslPath ( void )

Get the path to the openssl binary.

getPrivateKey()

public string SetaPDF_Signer_Signature_Module_OpenSslCli::getPrivateKey ( void )

Get the path to the private key file.

getPrivateKeyPassword()

public string SetaPDF_Signer_Signature_Module_OpenSslCli::getPrivateKeyPassword ( void )

Get the private key password source.

setCertificate()

public void SetaPDF_Signer_Signature_Module_OpenSslCli::setCertificate ( string $certificate )

Set the path to the signing certificate.

Parameters
$certificate : string
 
Exceptions

Throws InvalidArgumentException

setDigest()

public void SetaPDF_Signer_Signature_Module_OpenSslCli::setDigest ( string $digest )

Set the digest algorithm to use when signing.

Possible values are defined in SetaPDF_Signer_Digest.

Parameters
$digest : string
 
See

setExtraCertificates()

public void SetaPDF_Signer_Signature_Module_OpenSslCli::setExtraCertificates ( null|string $extraCertificates )

Set the path to a file with additional certificates which will be included in the signature.

If the certificates are saved in separate files, you will need to assemble them in one single file. Just copy them with a text editor one after another.

Parameters
$extraCertificates : null|string
 
Exceptions

Throws InvalidArgumentException

setOpenSslPath()

public void SetaPDF_Signer_Signature_Module_OpenSslCli::setOpenSslPath ( string $openSslPath )

Set the path to the openssl binary.

Parameters
$openSslPath : string
 

setPrivateKey()

public void SetaPDF_Signer_Signature_Module_OpenSslCli::setPrivateKey ( array|string $privateKey [, null $password = null ] )

Set the path to the private key file and password argument.

Parameters
$privateKey : array|string

An array of private key and password or only a private key.

$password : null
 
Exceptions

Throws InvalidArgumentException

setPrivateKeyPassword()

public void SetaPDF_Signer_Signature_Module_OpenSslCli::setPrivateKeyPassword ( string $password )

Set the private key password source.

Parameters
$password : string
 
See