Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[stable29] chore: validate signer of signed pdf file #4405

Merged
merged 2 commits into from
Jan 19, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/Handler/Pkcs12Handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ public function getCertificateChain($resource): array {
if (empty($certificates[$signerCounter]['chain'][$certificateIndex]['signature_validation'])) {
$certificates[$signerCounter]['chain'][$certificateIndex]['signature_validation'] = [
'id' => 1,
'label' => $this->l10n->t('Certificate is Trusted.'),
'label' => $this->l10n->t('Signature is valid.'),
];
}
}
Expand Down
10 changes: 9 additions & 1 deletion tests/integration/features/file/validate.feature
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ Feature: validate
And run the command "libresign:install --use-local-cert --java" with result code 0
And run the command "libresign:install --use-local-cert --jsignpdf" with result code 0
And run the command "libresign:install --use-local-cert --pdftk" with result code 0
And run the command "libresign:configure:openssl --cn test" with result code 0
And run the command "config:app:set libresign certificate_engine --value=openssl" with result code 0
And run the command "libresign:configure:openssl --cn=Common\ Name --c=BR --o=Organization --st=State\ of\ Company --l=City\ Name --ou=Organization\ Unit" with result code 0
And sending "post" to ocs "/apps/provisioning_api/api/v1/config/apps/libresign/identify_methods"
| value | (string)[{"name":"account","enabled":true,"mandatory":true,"signatureMethods":{"clickToSign":{"enabled":true}}}] |
And user "signer1" exists
Expand All @@ -29,3 +30,10 @@ Feature: validate
And as user ""
And sending "get" to ocs "/apps/libresign/api/v1/file/validate/uuid/<FILE_UUID>"
Then the response should have a status code 200
Then the response should be a JSON array with the following mandatory values
| key | value |
| (jq).ocs.data.signers[0].me | false |
| (jq).ocs.data.signers[0].uid | account:signer1 |
| (jq).ocs.data.signers[0].subject | /C=BR/ST=State of Company/L=City Name/O=Organization/OU=Organization Unit/UID=account:signer1/CN=signer1-displayname |
| (jq).ocs.data.signers[0].signature_validation | {"id":1,"label":"Signature is valid."} |
| (jq).ocs.data.signers[0].hash_algorithm | RSA-SHA1 |
Loading