Skip to content

Commit 42c52e0

Browse files
committed
Update README.md
1 parent 0341007 commit 42c52e0

1 file changed

Lines changed: 5 additions & 8 deletions

File tree

README.md

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ sign your PDF documents locally.
1818

1919
## Known not implemented features
2020

21-
At the moment the module do not support RSA_PSS or ECDSA as signing algorithm because of missing testing options.
21+
At the moment the module does not support RSA_PSS or ECDSA as signing algorithm because of missing testing options.
2222
Both are implemented but will throw an exception to get a chance for a test case. Please contact us at
2323
support@setasign.com so that we can work on a final implementation together.
2424

@@ -31,7 +31,7 @@ the OTP generation by yourself - see API `credentials/sendOTP` (11.8).
3131

3232
## Requirements
3333

34-
To use this package you need access to an CSC API.
34+
To use this package you need access to a CSC API.
3535

3636
This package is developed and tested on PHP >= 7.1. Requirements of the
3737
[SetaPDF-Signer](https://www.setasign.com/signer)
@@ -93,7 +93,7 @@ This class is a kind of proxy class to the CSC API. Its constructor requires the
9393
- `$requestFactory` PSR-17 HTTP Factory implementation.
9494
- `$streamFactory` PSR-17 HTTP Factory implementation.
9595

96-
If you need to call an endpoint which is not covered by a proxy method, you can use the `call()` method.
96+
If you need to call an endpoint which is not covered by a proxy method, you can use the `call(string $path, ?string $accessToken = null, array $inputData = [])` method.
9797

9898
### The `Module` class
9999

@@ -132,12 +132,8 @@ $credentialIds = ($client->credentialsList($accessToken)['credentialIds']);
132132
$credentialId = $credentialIds[0];
133133
// fetch all informations regarding your credential id like the certificates
134134
$credentialInfo = $client->credentialsInfo($accessToken, $credentialId, 'chain', true, true);
135-
135+
// get the certificate chain
136136
$certificates = $credentialInfo['cert']['certificates'];
137-
$certificates = array_map(function (string $certificate) {
138-
return new SetaPDF_Signer_X509_Certificate($certificate);
139-
}, $certificates);
140-
141137
// the first certificate is always the signing certificate
142138
$certificate = array_shift($certificates);
143139
$algorithm = $credentialInfo['key']['algo'][0];
@@ -148,6 +144,7 @@ $module = new setasign\SetaPDF\Signer\Module\CSC\Module(
148144
);
149145
$module->setSignatureAlgorithmOid($algorithm);
150146
$module->setCertificate($certificate);
147+
$module->setExtraCertificates($certificates);
151148
$module->setOtp($otp);
152149

153150
// the file to sign

0 commit comments

Comments
 (0)