Skip to content
Snippets Groups Projects
Commit 122b1526 authored by Jean-Laurent DUZANT's avatar Jean-Laurent DUZANT
Browse files

FIX TIME 0:40 fix invalid signature + testing/comparing signature data

parent 1e4cc5ac
No related branches found
No related tags found
No related merge requests found
......@@ -233,7 +233,7 @@ class MetaSignSignatureController
$tmpDocument = $signer->preSign(new \SetaPDF_Core_Writer_TempFile());
$resultSignature = MetaSignSignatureController::signHash([
'config' => $config,
'config' => $config,
'docHash' => base64_encode(hash_file('md5', $tmpDocument->getHashFile()->getPath())) ]);
if (!empty($resultSignature['errors']) || !empty($resultSignature['code'])) {
return ['code' => $resultSignature['code'], 'errors' => $resultSignature['errors']];
......@@ -302,8 +302,7 @@ class MetaSignSignatureController
"signatureKeyId" => $args['config']['metaSign']['signatureKeyId'],
"signatureProfile" => $args['config']['metaSign']['signatureProfile'],
"document" => [
"docContent" => $args['docHash'],
"mimeType" => "application/pdf"
"docHash" => $args['docHash']
]
])
]);
......@@ -312,6 +311,6 @@ class MetaSignSignatureController
return ['code' => $curlResponse['code'], 'errors' => $curlResponse['response']['errorInfo'] ?? $curlResponse['errors']];
}
return ['signatureContent' => base64_decode($curlResponse['response']['signatureContent']['bytes'])];
return ['signatureContent' => $curlResponse['response']['signatureContent']['bytes']];
}
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment