@@ -53,11 +53,11 @@ discard block |
||
| 53 | 53 | public static function fromASN1(UnspecifiedType $el): self |
| 54 | 54 | { |
| 55 | 55 | switch ($el->tag()) { |
| 56 | - case Element::TYPE_OCTET_STRING: |
|
| 57 | - case Element::TYPE_UTF8_STRING: |
|
| 58 | - return new self($el->asString()->string(), $el->tag()); |
|
| 59 | - case Element::TYPE_OBJECT_IDENTIFIER: |
|
| 60 | - return new self($el->asObjectIdentifier()->oid(), $el->tag()); |
|
| 56 | + case Element::TYPE_OCTET_STRING: |
|
| 57 | + case Element::TYPE_UTF8_STRING: |
|
| 58 | + return new self($el->asString()->string(), $el->tag()); |
|
| 59 | + case Element::TYPE_OBJECT_IDENTIFIER: |
|
| 60 | + return new self($el->asObjectIdentifier()->oid(), $el->tag()); |
|
| 61 | 61 | } |
| 62 | 62 | throw new \UnexpectedValueException( |
| 63 | 63 | "Type " . Element::tagToName($el->tag()) . " not supported."); |
@@ -155,12 +155,12 @@ discard block |
||
| 155 | 155 | public function toASN1(): Element |
| 156 | 156 | { |
| 157 | 157 | switch ($this->_type) { |
| 158 | - case Element::TYPE_OCTET_STRING: |
|
| 159 | - return new OctetString($this->_value); |
|
| 160 | - case Element::TYPE_UTF8_STRING: |
|
| 161 | - return new UTF8String($this->_value); |
|
| 162 | - case Element::TYPE_OBJECT_IDENTIFIER: |
|
| 163 | - return new ObjectIdentifier($this->_value); |
|
| 158 | + case Element::TYPE_OCTET_STRING: |
|
| 159 | + return new OctetString($this->_value); |
|
| 160 | + case Element::TYPE_UTF8_STRING: |
|
| 161 | + return new UTF8String($this->_value); |
|
| 162 | + case Element::TYPE_OBJECT_IDENTIFIER: |
|
| 163 | + return new ObjectIdentifier($this->_value); |
|
| 164 | 164 | } |
| 165 | 165 | throw new \LogicException( |
| 166 | 166 | "Type " . Element::tagToName($this->_type) . " not supported."); |