lib/X509/AttributeCertificate/Attribute/SvceAuthInfo.php 1 location
|
@@ 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. |
lib/X509/AttributeCertificate/IssuerSerial.php 1 location
|
@@ 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. |
lib/X509/AttributeCertificate/Attribute/RoleAttributeValue.php 1 location
|
@@ 68-82 (lines=15) @@
|
| 65 |
|
* @param UnspecifiedType $el |
| 66 |
|
* @return self |
| 67 |
|
*/ |
| 68 |
|
public static function fromASN1(UnspecifiedType $el) { |
| 69 |
|
$seq = $el->asSequence(); |
| 70 |
|
$authority = null; |
| 71 |
|
if ($seq->hasTagged(0)) { |
| 72 |
|
$authority = GeneralNames::fromASN1( |
| 73 |
|
$seq->getTagged(0) |
| 74 |
|
->asImplicit(Element::TYPE_SEQUENCE) |
| 75 |
|
->asSequence()); |
| 76 |
|
} |
| 77 |
|
$name = GeneralName::fromASN1( |
| 78 |
|
$seq->getTagged(1) |
| 79 |
|
->asExplicit() |
| 80 |
|
->asTagged()); |
| 81 |
|
return new self($name, $authority); |
| 82 |
|
} |
| 83 |
|
|
| 84 |
|
/** |
| 85 |
|
* Check whether issuing authority is present. |