setasign\SetaPDF2\Signer
TmpDocument Class for handling an intermediate version of the document that should be signed.
File: /SetaPDF v2/Signer/TmpDocument.php
Old class name (alias):
\SetaPDF_Signer_TmpDocument
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 : ?\setasign\SetaPDF2\Core\Writer\FileInterface
_getHashByDocument()
Get the SHA-256 hash by a document instance.
Parameters
- $document : \setasign\SetaPDF2\Core\Document
Exceptions
Throws \setasign\SetaPDF2\Core\Parser\Exception
Throws \setasign\SetaPDF2\Core\Reader\Exception
Throws 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 : \setasign\SetaPDF2\Core\Document
Exceptions
Throws \setasign\SetaPDF2\Core\Type\Exception
Throws \setasign\SetaPDF2\Core\Parser\Exception
Throws \setasign\SetaPDF2\Core\Reader\Exception
Throws Exception
setDocumentIdentification()
Set the document identification related data.
Parameters
- $document : \setasign\SetaPDF2\Core\Document
Exceptions
Throws Exception
Throws \setasign\SetaPDF2\Core\Parser\Exception
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