-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathparse_cms.php
More file actions
36 lines (29 loc) · 1.07 KB
/
Copy pathparse_cms.php
File metadata and controls
36 lines (29 loc) · 1.07 KB
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
<?php
require_once __DIR__.'/../vendor/autoload.php';
$t1 = microtime(true);
$signedData = \Adapik\CMS\SignedData::createFromContent(file_get_contents('php://stdin'));
$t2 = microtime(true);
echo 'Parsed in:' . ($t2 - $t1) . 's';
echo "\n";
echo 'Signature Type: ' . $signedData->getSignerInfo()[0]->defineType();
echo "\n";
$certificate = $signedData->extractCertificates()[0];
echo 'Issuer: ' . (string) $certificate->getIssuer();
echo "\n";
echo 'Subject: ' . (string) $certificate->getSubject();
echo "\n";
echo 'Valid Not Before: ' . $certificate->getValidNotBefore();
echo "\n";
echo 'Valid Not After: ' . $certificate->getValidNotAfter();
echo "\n";
echo 'Certificate subjectKeyIdentifier: ' . $certificate->getSubjectKeyIdentifier();
echo "\n";
echo 'Certificate authorityKeyIdentifier: ' . $certificate->getAuthorityKeyIdentifier();
echo "\n";
echo 'OCSP Uri: ' . implode(',', $certificate->getOcspUris());
echo "\n";
$t3 = microtime(true);
echo 'Total:' . ($t3 - $t1) . 's';
echo "\n";
echo 'Memory Usage:' . memory_get_peak_usage(true) . ' bytes';
echo "\n";