Conditions | 2 |
Paths | 2 |
Total Lines | 23 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Tests | 9 |
CRAP Score | 2.024 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
20 | 2 | public function __construct(AttestationObject $attestationObject) |
|
21 | { |
||
22 | 2 | parent::__construct($attestationObject, self::FORMAT_ID); |
|
23 | |||
24 | // See https://webkit.org/blog/11312/meet-face-id-and-touch-id-for-the-web/ |
||
25 | |||
26 | 2 | $statement = $attestationObject->getStatement(); |
|
27 | |||
28 | // Note: early iOS versions included an 'alg' parameter which was removed later |
||
29 | try { |
||
30 | 2 | DataValidator::checkMap( |
|
31 | 2 | $statement, |
|
32 | [ |
||
33 | 2 | 'x5c' => 'array', |
|
34 | ], |
||
35 | 2 | false |
|
36 | ); |
||
37 | } catch (DataValidationException $e) { |
||
38 | throw new ParseException('Invalid apple attestation statement.', 0, $e); |
||
39 | } |
||
40 | |||
41 | 2 | $x5c = $statement->get('x5c'); |
|
42 | 2 | $this->certificates = $this->buildPEMCertificateArray($x5c); |
|
43 | 2 | } |
|
53 |