SetaPDF_Signer_TmpDocument Class for handling an intermediate version of the document that should be signed.
File: /SetaPDF v2/Signer/TmpDocument.php
This class is used for an asyncron signature flow. Otherwise it is used internally.
Class hierarchy
Summary
Properties
$_byteRange
The byte range value
$_identficationHash
Hash of the last state of the intermediate document version.
Methods
__construct()
The constructor
The $writer parameter is optional and can be used in an asyncron workflow to have control over the temporary version of the document.
Parameters
- $writer : SetaPDF_Core_Writer_FileInterface
_getHashByDocument()
Get the SHA-256 hash by a document instance.
Parameters
- $document : SetaPDF_Core_Document
Exceptions
Throws SetaPDF_Signer_Exception
getHashFile()
Create and get the file path to a temporary file that represents the bytes that should be be used for hashing.
matchesDocument()
Checks whether the document instance matches this temporary version.
The checks are done by the instance identification of the class instance frist. If this does not match, because of an asyncron workflow the document identifications are compared.
Parameters
- $document : SetaPDF_Core_Document
save()
Saves the temporary document to a writer instance.
Parameters
- $writer : SetaPDF_Core_Writer_WriterInterface
setDocumentIdentification()
Set the document identification related data.
Parameters
- $document : SetaPDF_Core_Document
setWriter()
updateLastByteOffset()
Updates the last byte offset in the /ByteRange entry in the to be signed document.
Parameters
- $offset : int
- $position : int
- $length : int
writeSignature()
Writes the signature into the reserved gap.
The signature string needs to have the same length as the gap.
Parameters
- $signature : string