-
Notifications
You must be signed in to change notification settings - Fork 2
/
landing.php
52 lines (45 loc) · 1.65 KB
/
landing.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
<html>
<head>
<title>DSS test landing</title>
</head>
<body>
<h1>DSS test landing</h1>
<p>
<a href="./">back</a>
</p>
<?php
/*
* This page is where the DSS lands after creation of the signature.
*/
include_once 'dssp/dssp.php';
session_start();
$session = $_SESSION["DigitalSignatureServiceSession"];
$signResponse = $_POST["SignResponse"];
$dssInstance = "https://www.e-contract.be/dss-ws/";
//$dssInstance = "http://localhost/dss-ws/";
$location = $dssInstance . "dss";
$dssClient = new DigitalSignatureServiceClient($location);
$signResponseResult;
try {
$signResponseResult = $dssClient->checkSignResponse($signResponse, $session);
} catch (UserCancelledException $e) {
echo "<p>User Cancelled</p>";
die();
}
$pdfData = $dssClient->downloadSignedDocument($session);
$_SESSION["SignedPDF"] = $pdfData;
$verificationResult = $dssClient->verify($pdfData);
echo "<p>Signer identity: " . $signResponseResult->getSignerIdentity() . "</p>";
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>";
?>
<a href="signed-pdf.php">Download signed PDF</a>
</body>
</html>