-
Notifications
You must be signed in to change notification settings - Fork 2
/
verify.php
61 lines (53 loc) · 2.1 KB
/
verify.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
<html>
<head>
<title>DSS verify test</title>
</head>
<body>
<h1>DSS verify test</h1>
<?php
include_once "dssp/dssp.php";
$location = "https://www.e-contract.be/dss-ws/dss";
$dssClient = new DigitalSignatureServiceClient($location);
$pdf_handle = fopen("document-1.pdf", "r");
$pdfData = fread($pdf_handle, 65536);
fclose($pdf_handle);
$verificationResult = $dssClient->verify($pdfData);
echo "<p>Renew timestamp before: " . $verificationResult->renewTimeStampBefore . "</p>";
echo "<table>";
foreach ($verificationResult->signatureInfos as $signatureInfo) {
echo "<tr>";
echo "<td>" . $signatureInfo->signingTime . "</td>";
echo "<td>" . $signatureInfo->subject . "</td>";
echo "</tr>";
}
echo "</table>";
$pdf_handle = fopen("document-2.pdf", "r");
$pdfData = fread($pdf_handle, 128 * 1024);
fclose($pdf_handle);
$verificationResult = $dssClient->verify($pdfData);
echo "<p>Renew timestamp before: " . $verificationResult->renewTimeStampBefore . "</p>";
echo "<table>";
foreach ($verificationResult->signatureInfos as $signatureInfo) {
echo "<tr>";
echo "<td>" . $signatureInfo->signingTime . "</td>";
echo "<td>" . $signatureInfo->subject . "</td>";
echo "</tr>";
}
echo "</table>";
$pdf_handle = fopen("document.pdf", "r");
$pdfData = fread($pdf_handle, 128 * 1024);
fclose($pdf_handle);
$verificationResult = $dssClient->verify($pdfData);
echo "<p>Renew timestamp before: " . $verificationResult->renewTimeStampBefore . "</p>";
echo "<table>";
foreach ($verificationResult->signatureInfos as $signatureInfo) {
echo "<tr>";
echo "<td>" . $signatureInfo->signingTime . "</td>";
echo "<td>" . $signatureInfo->subject . "</td>";
echo "</tr>";
}
echo "</table>";
echo "<p>done</p>";
?>
</body>
</html>