| @@ 57-68 (lines=12) @@ | ||
| 54 | $this->_authInfo = $auth_info; |
|
| 55 | } |
|
| 56 | ||
| 57 | public static function fromASN1(UnspecifiedType $el) { |
|
| 58 | $seq = $el->asSequence(); |
|
| 59 | $service = GeneralName::fromASN1($seq->at(0)->asTagged()); |
|
| 60 | $ident = GeneralName::fromASN1($seq->at(1)->asTagged()); |
|
| 61 | $auth_info = null; |
|
| 62 | if ($seq->has(2, Element::TYPE_OCTET_STRING)) { |
|
| 63 | $auth_info = $seq->at(2) |
|
| 64 | ->asString() |
|
| 65 | ->string(); |
|
| 66 | } |
|
| 67 | return new static($service, $ident, $auth_info); |
|
| 68 | } |
|
| 69 | ||
| 70 | /** |
|
| 71 | * Get service name. |
|
| @@ 63-73 (lines=11) @@ | ||
| 60 | * @param Sequence $seq |
|
| 61 | * @return self |
|
| 62 | */ |
|
| 63 | public static function fromASN1(Sequence $seq) { |
|
| 64 | $issuer = GeneralNames::fromASN1($seq->at(0)->asSequence()); |
|
| 65 | $serial = $seq->at(1) |
|
| 66 | ->asInteger() |
|
| 67 | ->number(); |
|
| 68 | $uid = null; |
|
| 69 | if ($seq->has(2, Element::TYPE_BIT_STRING)) { |
|
| 70 | $uid = UniqueIdentifier::fromASN1($seq->at(2)->asBitString()); |
|
| 71 | } |
|
| 72 | return new self($issuer, $serial, $uid); |
|
| 73 | } |
|
| 74 | ||
| 75 | /** |
|
| 76 | * Initialize from a public key certificate. |
|