Skip to content

Commit

Permalink
Further split function
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolaasuni committed Mar 28, 2021
1 parent cbb9dc0 commit 154c338
Showing 1 changed file with 20 additions and 10 deletions.
30 changes: 20 additions & 10 deletions src/Output.php
Expand Up @@ -756,21 +756,14 @@ protected function getOutSignature()
.' /Filter /Adobe.PPKLite'
.' /SubFilter /adbe.pkcs7.detached '
.$this->byterange
.' /Contents<'.str_repeat('0', $this->sigmaxlen)
.'>';
.' /Contents<'.str_repeat('0', $this->sigmaxlen).'>';
if (empty($this->signature['approval']) || ($this->signature['approval'] != 'A')) {
$out .= ' /Reference [' // array of signature reference dictionaries
.' << /Type /SigRef';
if ($this->signature['cert_type'] > 0) {
$out .= ' /TransformMethod /DocMDP'
.' /TransformParams'
.' <<'
.' /Type /TransformParams'
.' /P '.$this->signature['cert_type']
.' /V /1.2'
.' >>'; // close TransformParams
$out .= $this->getOutSignatureDocMDP();
} else {
$this->getOutSignatureUserRights();
$out .= $this->getOutSignatureUserRights();
}
// optional digest data (values must be calculated and replaced later)
//$out .= ' /Data ********** 0 R'
Expand All @@ -788,6 +781,23 @@ protected function getOutSignature()
return $out;
}

/**
* Returns the PDF signarure entry
*
* @return string
*/
protected function getOutSignatureDocMDP()
{
$out .= ' /TransformMethod /DocMDP'
.' /TransformParams'
.' <<'
.' /Type /TransformParams'
.' /P '.$this->signature['cert_type']
.' /V /1.2'
.' >>';
return $out;
}

/**
* Returns the PDF signarure entry
*
Expand Down

0 comments on commit 154c338

Please sign in to comment.