lib/X509/AttributeCertificate/AttributeCertificate.php 1 location
|
@@ 63-72 (lines=10) @@
|
60 |
|
* @param Sequence $seq |
61 |
|
* @return self |
62 |
|
*/ |
63 |
|
public static function fromASN1(Sequence $seq) { |
64 |
|
$acinfo = AttributeCertificateInfo::fromASN1($seq->at(0)->asSequence()); |
65 |
|
$algo = AlgorithmIdentifier::fromASN1($seq->at(1)->asSequence()); |
66 |
|
if (!$algo instanceof SignatureAlgorithmIdentifier) { |
67 |
|
throw new \UnexpectedValueException( |
68 |
|
"Unsupported signature algorithm " . $algo->oid() . "."); |
69 |
|
} |
70 |
|
$signature = Signature::fromASN1($seq->at(2)->asBitString()); |
71 |
|
return new self($acinfo, $algo, $signature); |
72 |
|
} |
73 |
|
|
74 |
|
/** |
75 |
|
* Initialize from DER data. |
lib/X509/Certificate/Certificate.php 1 location
|
@@ 63-72 (lines=10) @@
|
60 |
|
* @param Sequence $seq |
61 |
|
* @return self |
62 |
|
*/ |
63 |
|
public static function fromASN1(Sequence $seq) { |
64 |
|
$tbsCert = TBSCertificate::fromASN1($seq->at(0)->asSequence()); |
65 |
|
$algo = AlgorithmIdentifier::fromASN1($seq->at(1)->asSequence()); |
66 |
|
if (!$algo instanceof SignatureAlgorithmIdentifier) { |
67 |
|
throw new \UnexpectedValueException( |
68 |
|
"Unsupported signature algorithm " . $algo->oid() . "."); |
69 |
|
} |
70 |
|
$signature = Signature::fromASN1($seq->at(2)->asBitString()); |
71 |
|
return new self($tbsCert, $algo, $signature); |
72 |
|
} |
73 |
|
|
74 |
|
/** |
75 |
|
* Initialize from DER. |
lib/X509/CertificationRequest/CertificationRequest.php 1 location
|
@@ 61-70 (lines=10) @@
|
58 |
|
* @param Sequence $seq |
59 |
|
* @return self |
60 |
|
*/ |
61 |
|
public static function fromASN1(Sequence $seq) { |
62 |
|
$info = CertificationRequestInfo::fromASN1($seq->at(0)->asSequence()); |
63 |
|
$algo = AlgorithmIdentifier::fromASN1($seq->at(1)->asSequence()); |
64 |
|
if (!$algo instanceof SignatureAlgorithmIdentifier) { |
65 |
|
throw new \UnexpectedValueException( |
66 |
|
"Unsupported signature algorithm " . $algo->oid() . "."); |
67 |
|
} |
68 |
|
$signature = Signature::fromASN1($seq->at(2)->asBitString()); |
69 |
|
return new self($info, $algo, $signature); |
70 |
|
} |
71 |
|
|
72 |
|
/** |
73 |
|
* Initialize from DER. |