Passed
Push — master ( 83aa3d...907404 )
by Thomas
07:17
created

AppleDeviceMetadata::getTrustAnchors()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 4
ccs 0
cts 2
cp 0
crap 2
rs 10
1
<?php
2
3
namespace MadWizard\WebAuthn\Metadata\Provider\Apple;
4
5
use MadWizard\WebAuthn\Attestation\AttestationType;
6
use MadWizard\WebAuthn\Attestation\TrustAnchor\CertificateTrustAnchor;
7
use MadWizard\WebAuthn\Attestation\TrustAnchor\MetadataInterface;
8
use MadWizard\WebAuthn\Pki\X509Certificate;
9
use MadWizard\WebAuthn\Util\BundledData;
10
11
final class AppleDeviceMetadata implements MetadataInterface
12
{
13
    public function getTrustAnchors(): array
14
    {
15
        return [
16
            new CertificateTrustAnchor(X509Certificate::fromPem(BundledData::getContents('apple/apple-webauthn-root.crt'))),
17
        ];
18
    }
19
20
    public function supportsAttestationType(string $type): bool
21
    {
22
        return $type === AttestationType::ANON_CA;
23
    }
24
25
    public function getStatusReports(): array
26
    {
27
        return [];
28
    }
29
30
    public function getDescription(): string
31
    {
32
        return 'Apple device (Touch ID / Face ID)';
33
    }
34
}
35