File tree 2 files changed +21
-4
lines changed
2 files changed +21
-4
lines changed Original file line number Diff line number Diff line change @@ -31,6 +31,11 @@ class SignatureModule implements
31
31
*/
32
32
protected $ identity ;
33
33
34
+ /**
35
+ * @var bool
36
+ */
37
+ protected $ addRevocationInfo = true ;
38
+
34
39
/**
35
40
* The constructor.
36
41
*
@@ -63,6 +68,16 @@ public function getCertificate(): string
63
68
return $ this ->identity ->getSigningCertificate ();
64
69
}
65
70
71
+ /**
72
+ * Define whether to add revocation information to the CMS container or not (default = true).
73
+ *
74
+ * @param bool $addRevocationInfo
75
+ */
76
+ public function setAddRevocationInfo ($ addRevocationInfo )
77
+ {
78
+ $ this ->addRevocationInfo = (bool )$ addRevocationInfo ;
79
+ }
80
+
66
81
/**
67
82
* Create a signature for the file in the given $tmpPath.
68
83
*
@@ -77,9 +92,11 @@ public function createSignature(\SetaPDF_Core_Reader_FilePath $tmpPath): string
77
92
$ trustChain = $ this ->client ->getTrustchain ();
78
93
$ this ->module ->setExtraCertificates ($ trustChain ->trustchain );
79
94
80
- $ this ->module ->addOcspResponse (\base64_decode ($ this ->identity ->getOcspResponse ()));
81
- foreach ($ trustChain ->ocsp_revocation_info as $ ocspRevocationInfo ) {
82
- $ this ->module ->addOcspResponse (\base64_decode ($ ocspRevocationInfo ));
95
+ if ($ this ->addRevocationInfo ) {
96
+ $ this ->module ->addOcspResponse (\base64_decode ($ this ->identity ->getOcspResponse ()));
97
+ foreach ($ trustChain ->ocsp_revocation_info as $ ocspRevocationInfo ) {
98
+ $ this ->module ->addOcspResponse (\base64_decode ($ ocspRevocationInfo ));
99
+ }
83
100
}
84
101
85
102
$ hash = \hash ('sha256 ' , $ this ->module ->getDataToSign ($ tmpPath ));
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ public function testWithoutNoClientCertificates(): void
20
20
21
21
/**
22
22
* @expectedException \GuzzleHttp\Exception\ClientException
23
- * @expectedExceptionMessage 422 Unprocessable Entity
23
+ * @expectedExceptionMessage 400 Bad Request
24
24
*/
25
25
public function testFailedLogin ()
26
26
{
You can’t perform that action at this time.
0 commit comments