setasign\SetaPDF2\Signer
DocumentSecurityStore Class representing a "Document Security Store" in a PDF document.
File: /SetaPDF v2/Signer/DocumentSecurityStore.php
Old class name (alias):
\SetaPDF_Signer_DocumentSecurityStore
Class hierarchy
Summary
Methods
- __construct()
- _addStream()
- _getStreams()
- addCRL()
- addCRLs()
- addCertificate()
- addCertificates()
- addOCSP()
- addOCSPs()
- addValidationRelatedInfo()
- addValidationRelatedInfoByField()
- addValidationRelatedInfoByFieldName()
- cleanUp()
- getCRLs()
- getCertificates()
- getDictionary()
- getOCSPs()
- getOptimizeOcspResponses()
- getSignatureDigest()
- getValidationRelatedInfo()
- getValidationRelatedInfoByField()
- getValidationRelatedInfoByFieldName()
- getVriName()
- getVriNameByFieldName()
- setOptimizeOcspResponses()
Properties
$_optimizeOcspResponses
Defines whether OCSP responses should be embedded including their optional certificates (false) or not (true).
Methods
__construct()
_addStream()
string $data
Adds a stream to the DSS data.
Parameters
- $type : string
The type/key to which the data should be added.
- $data : string
Exceptions
Throws \setasign\SetaPDF2\Core\SecHandler\Exception
Throws \setasign\SetaPDF2\Core\Type\Exception
Throws \setasign\SetaPDF2\Exception
_getStreams()
Get a stream by its type from the DSS dictionary.
Parameters
- $type : string
Exceptions
Throws \setasign\SetaPDF2\Core\SecHandler\Exception
Throws \setasign\SetaPDF2\Core\Type\Exception
Throws \setasign\SetaPDF2\Exception
addCRL()
Add a CRL to the CRLs entry in the DSS dictionary.
Parameters
- $crl : string|\SetaPDF_Signer_X509_Crl
Exceptions
Throws \setasign\SetaPDF2\Core\SecHandler\Exception
Throws \setasign\SetaPDF2\Core\Type\Exception
Throws \setasign\SetaPDF2\Exception
addCRLs()
Add CRLs to the CRLs entry in the DSS dictionary.
Parameters
- $crls : string[]|\SetaPDF_Signer_X509_Crl[]
Exceptions
Throws \setasign\SetaPDF2\Core\SecHandler\Exception
Throws \setasign\SetaPDF2\Core\Type\Exception
Throws \setasign\SetaPDF2\Exception
addCertificate()
Add a certificate to the Certs entry in the DSS dictionary.
Parameters
- $certificate : string|\SetaPDF_Signer_X509_Certificate
Exceptions
Throws \setasign\SetaPDF2\Core\SecHandler\Exception
Throws \setasign\SetaPDF2\Core\Type\Exception
Throws \setasign\SetaPDF2\Exception
Throws \setasign\SetaPDF2\NotImplementedException
Throws Asn1\Exception
addCertificates()
Add certificates to the Certs entry in the DSS dictionary.
Parameters
- $certificates : string[]|\SetaPDF_Signer_X509_Certificate[]
Exceptions
Throws \setasign\SetaPDF2\Core\SecHandler\Exception
Throws \setasign\SetaPDF2\Core\Type\Exception
Throws \setasign\SetaPDF2\Exception
Throws \setasign\SetaPDF2\NotImplementedException
Throws Asn1\Exception
addOCSP()
Add a OCSP response to the OCSPs entry in the DSS dictionary.
Parameters
- $ocspResponse : string|\SetaPDF_Signer_Ocsp_Response
Exceptions
Throws \setasign\SetaPDF2\Core\SecHandler\Exception
Throws \setasign\SetaPDF2\Core\Type\Exception
Throws \setasign\SetaPDF2\Exception
Throws \setasign\SetaPDF2\NotImplementedException
Throws Asn1\Exception
Throws Exception
addOCSPs()
Add OCSP responses to the OCSPs entry in the DSS dictionary.
Parameters
- $ocsps : string[]|\SetaPDF_Signer_Ocsp_Response
Exceptions
Throws \setasign\SetaPDF2\Core\SecHandler\Exception
Throws \setasign\SetaPDF2\Core\Type\Exception
Throws \setasign\SetaPDF2\Exception
Throws \setasign\SetaPDF2\NotImplementedException
Throws Asn1\Exception
Throws Exception
addValidationRelatedInfo()
array $crls = array ( ),
array $ocsps = array ( ),
array $certs = array ( ),
null|\SetaPDF_Core_DataStructure_Date|DateTime|string $timestamp = null
Add validation related information to the VRI dictionary of the DSS dictionary.
Parameters
- $key : string
The sha1 digest of the signature.
- $crls : array
An array of strings, X509\Crl instances or \setasign\SetaPDF2\Core\Type\IndirectObjectInterface to streams of the CRLs.
- $ocsps : array
An array of strings, Ocsp\Response instances or \setasign\SetaPDF2\Core\Type\IndirectObjectInterface to streams of the OCSPs.
- $certs : array
An array of strings, X509\Certificate instances or \setasign\SetaPDF2\Core\Type\IndirectObjectInterface to streams of the certs.
- $timestamp : null|\SetaPDF_Core_DataStructure_Date|DateTime|string
Exceptions
Throws \setasign\SetaPDF2\Core\SecHandler\Exception
Throws \setasign\SetaPDF2\Core\Type\Exception
Throws \setasign\SetaPDF2\Exception
Throws \setasign\SetaPDF2\NotImplementedException
Throws Asn1\Exception
Throws Exception
Throws \Exception
addValidationRelatedInfoByField()
WARNING: This method is marked as deprecated!
Use DocumentSecurityStore::addValidationRelatedInfoByFieldName() instead.
array $crls = array ( ),
array $ocsps = array ( ),
array $certs = array ( ),
null|\SetaPDF_Core_DataStructure_Date|DateTime|string $timestamp = null
Parameters
- $fieldName : string
The signature field name.
- $crls : array
An array of strings or \setasign\SetaPDF2\Core\Type\IndirectObjectInterface to streams of the CRLs.
- $ocsps : array
An array of strings or \setasign\SetaPDF2\Core\Type\IndirectObjectInterface to streams of the OCSPs.
- $certs : array
An array of strings or \setasign\SetaPDF2\Core\Type\IndirectObjectInterface to streams of the certs.
- $timestamp : null|\SetaPDF_Core_DataStructure_Date|DateTime|string
Exceptions
Throws \setasign\SetaPDF2\Core\SecHandler\Exception
Throws \setasign\SetaPDF2\Core\Type\Exception
Throws \setasign\SetaPDF2\Exception
Throws \setasign\SetaPDF2\NotImplementedException
Throws Asn1\Exception
Throws Exception
See
addValidationRelatedInfoByFieldName()
array $crls = array ( ),
array $ocsps = array ( ),
array $certs = array ( ),
null|\SetaPDF_Core_DataStructure_Date|DateTime|string $timestamp = null
Add validation related information to the VRI dictionary of the DSS dictionary by a specific signature field.
Parameters
- $fieldName : string
The signature field name.
- $crls : array
An array of strings or \setasign\SetaPDF2\Core\Type\IndirectObjectInterface to streams of the CRLs.
- $ocsps : array
An array of strings or \setasign\SetaPDF2\Core\Type\IndirectObjectInterface to streams of the OCSPs.
- $certs : array
An array of strings or \setasign\SetaPDF2\Core\Type\IndirectObjectInterface to streams of the certs.
- $timestamp : null|\SetaPDF_Core_DataStructure_Date|DateTime|string
Exceptions
Throws \setasign\SetaPDF2\Core\SecHandler\Exception
Throws \setasign\SetaPDF2\Core\Type\Exception
Throws \setasign\SetaPDF2\Exception
Throws \setasign\SetaPDF2\NotImplementedException
Throws Asn1\Exception
Throws Exception
getCRLs()
Get all CRLs the OCSPs entry in the DSS dictionary.
Exceptions
Throws \setasign\SetaPDF2\Core\SecHandler\Exception
Throws \setasign\SetaPDF2\Core\Type\Exception
Throws \setasign\SetaPDF2\Exception
getCertificates()
Get all certificates from the Certs entry in the DSS dictionary.
Exceptions
Throws \setasign\SetaPDF2\Core\SecHandler\Exception
Throws \setasign\SetaPDF2\Core\Type\Exception
Throws \setasign\SetaPDF2\Exception
getDictionary()
Get and/or creates the DSS dictionary.
Parameters
- $create : bool
Exceptions
getOCSPs()
Get all OCSP responses from the OCSPs entry in the DSS dictionary.
Exceptions
Throws \setasign\SetaPDF2\Core\SecHandler\Exception
Throws \setasign\SetaPDF2\Core\Type\Exception
Throws \setasign\SetaPDF2\Exception
getSignatureDigest()
WARNING: This method is marked as deprecated!
Use DocumentSecurityStore::getVriNameByFieldName() instead.
Parameters
- $fieldName : string
Exceptions
Throws \setasign\SetaPDF2\Core\Exception
Throws \setasign\SetaPDF2\Core\SecHandler\Exception
Throws \setasign\SetaPDF2\Core\Type\Exception
Throws \setasign\SetaPDF2\Core\Type\IndirectReference\Exception
Throws Asn1\Exception
Throws Exception
See
getValidationRelatedInfo()
Get validation related information.
Parameters
- $vriKey : ?string
The sha1 digest of the signature to get a specific information. Otherwise all found validation data is returned.
Exceptions
Throws \setasign\SetaPDF2\Core\SecHandler\Exception
Throws \setasign\SetaPDF2\Core\Type\Exception
Throws \setasign\SetaPDF2\Exception
getValidationRelatedInfoByField()
WARNING: This method is marked as deprecated!
Use DocumentSecurityStore::getValidationRelatedInfoByFieldName() instead.
Parameters
- $fieldName : string
The signature field name.
Exceptions
Throws \setasign\SetaPDF2\Core\SecHandler\Exception
Throws \setasign\SetaPDF2\Core\Type\Exception
Throws \setasign\SetaPDF2\Exception
Throws \setasign\SetaPDF2\NotImplementedException
Throws Asn1\Exception
See
getValidationRelatedInfoByFieldName()
Get validation related information by a signature field name.
Parameters
- $fieldName : string
The signature field name.
Exceptions
Throws \setasign\SetaPDF2\Core\SecHandler\Exception
Throws \setasign\SetaPDF2\Core\Type\Exception
Throws \setasign\SetaPDF2\Exception
Throws \setasign\SetaPDF2\NotImplementedException
Throws Asn1\Exception
getVriName()
Get the signature digest of a CRL or OCSP response which can be used as an index in the VRI dictionary.
Parameters
- $object : \SetaPDF_Signer_Asn1_Signed
getVriNameByFieldName()
Get the signature digest of a signature field, which can be used as an index in the VRI dictionary.
For a document signature the bytes that are hashed are those of the signature's DER-encoded PKCS#7 (and its derivatives) binary data object (base-16 decoded byte string in the Contents entry in the signature dictionary).For the signatures of the CRL and OCSP response, it is the respective signature object represented as a BER-encoded OCTET STRING encoded with primitive encoding.
For a Time-stamp's signature it is the bytes of the Time-stamp itself since the Time-stamp token is a signed data object.
Parameters
- $fieldName : string
Exceptions
Throws \setasign\SetaPDF2\Core\Exception
Throws \setasign\SetaPDF2\Core\SecHandler\Exception
Throws \setasign\SetaPDF2\Core\Type\Exception
Throws \setasign\SetaPDF2\Core\Type\IndirectReference\Exception
Throws Asn1\Exception
Throws Exception
setOptimizeOcspResponses()
Define whether OCSP responses should be optimized or not.
By optimizing (default = true) the OCSP responses the certificates are removed as they are normally embedded via addCertificates(), too. By doing this the certificates are not embedded twice.
Anyhow, there are validation enginges on the road which EXPECTS this optional field to be available.
Parameters
- $optimizeOcspResponses : bool