CMS Module (PHP)
Table of Contents
Description
The SetaPDF_Signer_Signature_Module_Cms
module makes use of an implementation of the CMS (Cryptographic Message Syntax) for digital signatures in plain PHP. It makes use of explicit signed attributes and builds the basis for individual signature modules that need the option to exert influence on the CMS structure.
The module makes use of the PHP build-in OpenSSL function openssl_sign() to create the final signature. It also gives you the opportunity to use all available digest algorithms. By default it uses SHA-256.
The certificate needs to be passed as a string or file path and needs to be PEM (Base64) encoded.
The private key data has to be passed as described here.
Public Methods
addCrl()
Adds an CRL which will be embedded in the CMS structure.
addOcspResponse()
Adds an OCSP response which will be embedded in the CMS structure.
getCertificate()
Get the certificate value.
getCms()
Get the complete Cryptographic Message Syntax structure.
getDataToSign()
Get the data which needs to be digitally signed.
getDigest()
Get the digest algorithm.
getParsedCertificate()
Ensures a certificate parameter and parses it into an ASN.1 element object structure.
setCertificate()
Set the signing certificate (PEM).
setDigest()
Set the digest algorithm to use when signing.
setExtraCertificates()
Add additional certificates which are placed into the CMS structure.
setPrivateKey()
Set the the private key or a path to the private key file and password argument.
setSignatureValue()
Set the signature value.