Debian Codegraph @

lib/3rdParty/composer/spomky-labs/pki-framework/src/X509/Certificate/Extension/DistributionPoint/FullName.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\X509\GeneralName\GeneralNames;
9 use SpomkyLabs\Pki\X509\GeneralName\UniformResourceIdentifier;
10
11 /**
12 * Implements 'fullName' ASN.1 CHOICE type of *DistributionPointName* used by 'CRL Distribution Points' certificate
13 * extension.
14 *
15 * @see https://tools.ietf.org/html/rfc5280#section-4.2.1.13
16 */
17 final class FullName extends DistributionPointName
18 {
19 private function __construct(
20 private readonly GeneralNames $names
21 ) {
22 parent::__construct(self::TAG_FULL_NAME);
23 }
24
25 public static function create(GeneralNames $names): self
26 {
27 return new self($names);
28 }
29
30 /**
31 * Initialize with a single URI.
32 */
33 public static function fromURI(string $uri): self
34 {
35 return self::create(GeneralNames::create(UniformResourceIdentifier::create($uri)));
36 }
37
38 public function names(): GeneralNames
39 {
40 return $this->names;
41 }
42
43 protected function _valueASN1(): Element
44 {
45 return $this->names->toASN1();
46 }
47 }