summaryrefslogtreecommitdiff
path: root/src/ClientCertificate.php
blob: d2b9530a98287ddc95158efb576237b9d3c9fe80 (plain)
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
<?php

namespace GeminiFoundation;

class ClientCertificate
{
  protected \OpenSSLCertificate $certificate;

  public function __construct(\OpenSSLCertificate $certificate)
  {
    $this->certificate = $certificate;
  }

  public function getObject(): \OpenSSLCertificate
  {
    return $this->certificate;
  }

  public function getFingerprint(): string
  {
    return openssl_x509_fingerprint($this->certificate);
  }

  public function parse(): array
  {
    return openssl_x509_parse($this->certificate);
  }
}