Debian Codegraph @

lib/3rdParty/composer/spomky-labs/pki-framework/src/X509/Certificate/Extension/DistributionPoint/RelativeName.php

raw symbols SCIP
1 <?php
2
3 declare(strict_types=1);
4
5 namespace SpomkyLabs\Pki\X509\Certificate\Extension\DistributionPoint;
6
7 use SpomkyLabs\Pki\ASN1\Element;
8 use SpomkyLabs\Pki\X501\ASN1\RDN;
9
10 /**
11 * Implements 'nameRelativeToCRLIssuer' ASN.1 CHOICE type of *DistributionPointName* used by 'CRL Distribution Points'
12 * certificate extension.
13 *
14 * @see https://tools.ietf.org/html/rfc5280#section-4.2.1.13
15 */
16 final class RelativeName extends DistributionPointName
17 {
18 private function __construct(
19 private readonly RDN $rdn
20 ) {
21 parent::__construct(self::TAG_RDN);
22 }
23
24 public static function create(RDN $rdn): self
25 {
26 return new self($rdn);
27 }
28
29 public function rdn(): RDN
30 {
31 return $this->rdn;
32 }
33
34 protected function _valueASN1(): Element
35 {
36 return $this->rdn->toASN1();
37 }
38 }