mirror of
https://github.com/LibreSign/libresign.git
synced 2025-12-18 05:20:45 +01:00
feat: add reason of signature
Signed-off-by: Vitor Mattos <vitor@php.rio>
This commit is contained in:
parent
0f9f70c967
commit
b42d41cecf
3 changed files with 14 additions and 0 deletions
|
|
@ -418,6 +418,7 @@ class Pkcs12Handler extends SignEngineHandler {
|
||||||
->setPassword($this->getPassword())
|
->setPassword($this->getPassword())
|
||||||
->setSignatureParams($this->getSignatureParams())
|
->setSignatureParams($this->getSignatureParams())
|
||||||
->setVisibleElements($this->getVisibleElements())
|
->setVisibleElements($this->getVisibleElements())
|
||||||
|
->setReason($this->getReason())
|
||||||
->getSignedContent();
|
->getSignedContent();
|
||||||
$this->getInputFile()->putContent($signedContent);
|
$this->getInputFile()->putContent($signedContent);
|
||||||
return $this->getInputFile();
|
return $this->getInputFile();
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,7 @@ abstract class SignEngineHandler implements ISignEngineHandler {
|
||||||
private File $inputFile;
|
private File $inputFile;
|
||||||
protected string $certificate;
|
protected string $certificate;
|
||||||
private string $password = '';
|
private string $password = '';
|
||||||
|
private string $reason = '';
|
||||||
/** @var VisibleElementAssoc[] */
|
/** @var VisibleElementAssoc[] */
|
||||||
private array $visibleElements = [];
|
private array $visibleElements = [];
|
||||||
private array $signatureParams = [];
|
private array $signatureParams = [];
|
||||||
|
|
@ -59,6 +60,15 @@ abstract class SignEngineHandler implements ISignEngineHandler {
|
||||||
return $this->password;
|
return $this->password;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function setReason(string $reason): self {
|
||||||
|
$this->reason = $reason;
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getReason(): string {
|
||||||
|
return $this->reason;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param VisibleElementAssoc[] $visibleElements
|
* @param VisibleElementAssoc[] $visibleElements
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -300,6 +300,9 @@ class SignFileService {
|
||||||
->setVisibleElements($this->elements)
|
->setVisibleElements($this->elements)
|
||||||
->setPassword($this->password)
|
->setPassword($this->password)
|
||||||
->setSignatureParams($signatureParams)
|
->setSignatureParams($signatureParams)
|
||||||
|
->setReason($this->l10n->t('Signed by %s with LibreSign.coop', [
|
||||||
|
$this->signRequest->getDisplayName() . ' <' . $this->userUniqueIdentifier . '>'
|
||||||
|
]))
|
||||||
->sign();
|
->sign();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue