| @@ 44-53 (lines=10) @@ | ||
| 41 | return new self($critical, ...$attribs); |
|
| 42 | } |
|
| 43 | ||
| 44 | protected function _valueASN1() { |
|
| 45 | if (!count($this->_attributes)) { |
|
| 46 | throw new \LogicException("No attributes"); |
|
| 47 | } |
|
| 48 | $elements = array_map( |
|
| 49 | function (Attribute $attr) { |
|
| 50 | return $attr->toASN1(); |
|
| 51 | }, array_values($this->_attributes)); |
|
| 52 | return new Sequence(...$elements); |
|
| 53 | } |
|
| 54 | } |
|
| 55 | ||
| @@ 99-108 (lines=10) @@ | ||
| 96 | return $this->get(PolicyInformation::OID_ANY_POLICY); |
|
| 97 | } |
|
| 98 | ||
| 99 | protected function _valueASN1() { |
|
| 100 | if (!count($this->_policies)) { |
|
| 101 | throw new \LogicException("No policies."); |
|
| 102 | } |
|
| 103 | $elements = array_map( |
|
| 104 | function (PolicyInformation $pi) { |
|
| 105 | return $pi->toASN1(); |
|
| 106 | }, array_values($this->_policies)); |
|
| 107 | return new Sequence(...$elements); |
|
| 108 | } |
|
| 109 | ||
| 110 | /** |
|
| 111 | * Get the number of policies. |
|