OpenSSL Module (PHP)
Description
The SetaPDF_Signer_Signature_Module_OpenSsl
module makes use of the PHP build-in OpenSSL function openssl_pkcs7_sign() to create the signature.
The function uses the SHA-1 digest algorithm (as documentated on php.net) or SHA-256 depending on the OpenSSL version installed on the server you are using. After all you have no control over the digest algorithm!
The certificate and private key data has to be passed as described here.
Public Methods
Get the certificate parameter.
Description
Get the certificate parameter.
Get the extra certificate parameter.
Description
Get the extra certificate parameter.
Get the private key parameter
Description
Get the private key parameter
Set the certificate parameter.
Description
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
-
Set the extra certificate parameter.
Description
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
-
Set the private key parameter.
Description
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
-
Demo