File tree Expand file tree Collapse file tree 4 files changed +20
-1
lines changed Expand file tree Collapse file tree 4 files changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -144,7 +144,12 @@ private function signWrapper(JSignPDF $jSignPDF): string {
144
144
$ param
145
145
->setJSignParameters (
146
146
$ this ->jSignParam ->getJSignParameters () .
147
- ' --hash-algorithm ' . $ this ->getHashAlgorithm ()
147
+ ' --hash-algorithm ' . $ this ->getHashAlgorithm () .
148
+ (
149
+ $ this ->getReason ()
150
+ ? ' --reason " ' . $ this ->getReason () . '" '
151
+ : ''
152
+ )
148
153
);
149
154
$ jSignPDF ->setParam ($ param );
150
155
return $ jSignPDF ->sign ();
Original file line number Diff line number Diff line change @@ -423,6 +423,7 @@ public function sign(): File {
423
423
->setInputFile ($ this ->getInputFile ())
424
424
->setPassword ($ this ->getPassword ())
425
425
->setVisibleElements ($ this ->getVisibleElements ())
426
+ ->setReason ($ this ->getReason ())
426
427
->sign ();
427
428
$ this ->getInputFile ()->putContent ($ signedContent );
428
429
return $ this ->getInputFile ();
Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ abstract class SignEngineHandler implements ISignEngineHandler {
15
15
private File $ inputFile ;
16
16
private string $ certificate ;
17
17
private string $ password = '' ;
18
+ private string $ reason = '' ;
18
19
/** @var VisibleElementAssoc[] */
19
20
private array $ visibleElements = [];
20
21
@@ -54,6 +55,15 @@ public function getPassword(): string {
54
55
return $ this ->password ;
55
56
}
56
57
58
+ public function setReason (string $ reason ): self {
59
+ $ this ->reason = $ reason ;
60
+ return $ this ;
61
+ }
62
+
63
+ public function getReason (): string {
64
+ return $ this ->reason ;
65
+ }
66
+
57
67
/**
58
68
* @param VisibleElementAssoc[] $visibleElements
59
69
*
Original file line number Diff line number Diff line change @@ -266,6 +266,9 @@ public function sign(): File {
266
266
->setCertificate ($ pfxFileContent )
267
267
->setVisibleElements ($ this ->elements )
268
268
->setPassword ($ this ->password )
269
+ ->setReason ($ this ->l10n ->t ('Signed by %s with LibreSign.coop ' , [
270
+ $ this ->signRequest ->getDisplayName () . ' < ' . $ this ->userUniqueIdentifier . '> '
271
+ ]))
269
272
->sign ();
270
273
break ;
271
274
default :
You can’t perform that action at this time.
0 commit comments