RelativeName::_valueASN1()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
nc 1
cc 1
nop 0
crap 1
1
<?php
2
3
declare(strict_types = 1);
4
5
namespace X509\Certificate\Extension\DistributionPoint;
6
7
use ASN1\Type\Constructed\Set;
8
use X501\ASN1\RDN;
9
10
/**
11
 * Implements 'nameRelativeToCRLIssuer' ASN.1 CHOICE type of
12
 * <i>DistributionPointName</i> used by 'CRL Distribution Points'
13
 * certificate extension.
14
 *
15
 * @link https://tools.ietf.org/html/rfc5280#section-4.2.1.13
16
 */
17
class RelativeName extends DistributionPointName
18
{
19
    /**
20
     * Relative distinguished name.
21
     *
22
     * @var RDN $_rdn
23
     */
24
    protected $_rdn;
25
    
26
    /**
27
     * Constructor.
28
     *
29
     * @param RDN $rdn
30
     */
31 12
    public function __construct(RDN $rdn)
32
    {
33 12
        $this->_tag = self::TAG_RDN;
34 12
        $this->_rdn = $rdn;
35 12
    }
36
    
37
    /**
38
     * Get RDN.
39
     *
40
     * @return RDN
41
     */
42 2
    public function rdn(): RDN
43
    {
44 2
        return $this->_rdn;
45
    }
46
    
47
    /**
48
     *
49
     * {@inheritdoc}
50
     * @return Set
51
     */
52 16
    protected function _valueASN1(): Set
53
    {
54 16
        return $this->_rdn->toASN1();
55
    }
56
}
57