setasign\SetaPDF2\Signer\Signature\Module
OpenSsl A signature module which uses the PHP builtin openssl functions.
File: /SetaPDF v2/Signer/Signature/Module/OpenSsl.php
Old class name (alias):
\SetaPDF_Signer_Signature_Module_OpenSsl
This module make use of the function openssl_pkcs7_sign() to create the signature.
Class hierarchy
Implements
Summary
Properties
$_certificate
$_extraCertificates
The path to a file containing bunch of extra certificates to include in the signature
$_privateKey
Methods
createSignature()
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 \setasign\SetaPDF2\Signer\Exception
Throws \InvalidArgumentException if the $tmpPath isn't readable
setCertificate()
Set the certificate parameter.
This module make use of the build in openssl functions. So the certificate parameter has to be passed as defined here: http://php.net/openssl.certparams.
Some examples:
$module->setCertificate(file_get_contents('path/to/certificate.pem')); // or $module->setCertificate('file://path/to/certificate.pem');
Notice the "file://" prefix if you need to pass the certificate path instead of its content.
Parameters
- $certificate : mixed
setExtraCertificates()
Set the extra certificate parameter.
This parameter specifies the name of a file containing a bunch of extra certificates to include in the signature which can for example be used to help the recipient to verify the certificate that you used.
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 : string
setPrivateKey()
Set the private key parameter.
This module make use of the build in openssl functions. So the private key parameter has to be passed as defined here: http://php.net/openssl.certparams.
Parameters
- $privateKey : mixed