| @@ 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 | ||
| @@ 86-95 (lines=10) @@ | ||
| 83 | return $this->_policies[$oid]; |
|
| 84 | } |
|
| 85 | ||
| 86 | protected function _valueASN1() { |
|
| 87 | if (!count($this->_policies)) { |
|
| 88 | throw new \LogicException("No policies."); |
|
| 89 | } |
|
| 90 | $elements = array_map( |
|
| 91 | function (PolicyInformation $pi) { |
|
| 92 | return $pi->toASN1(); |
|
| 93 | }, array_values($this->_policies)); |
|
| 94 | return new Sequence(...$elements); |
|
| 95 | } |
|
| 96 | ||
| 97 | /** |
|
| 98 | * Get the number of policies. |
|