Failed Conditions
Push — master ( bbfade...32fb37 )
by Florent
02:44
created

AttestedCredentialData   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 53
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
dl 0
loc 53
rs 10
c 0
b 0
f 0
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getCredentialId() 0 3 1
A __construct() 0 5 1
A getAaguid() 0 3 1
A getCredentialPublicKey() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * The MIT License (MIT)
7
 *
8
 * Copyright (c) 2018 Spomky-Labs
9
 *
10
 * This software may be modified and distributed under the terms
11
 * of the MIT license.  See the LICENSE file for details.
12
 */
13
14
namespace U2FAuthentication\Fido2;
15
16
use CBOR\CBORObject;
17
18
class AttestedCredentialData
19
{
20
    /**
21
     * @var string
22
     */
23
    private $aaguid;
24
25
    /**
26
     * @var string
27
     */
28
    private $credentialId;
29
30
    /**
31
     * @var null|CBORObject
32
     */
33
    private $credentialPublicKey;
34
35
    /**
36
     * AttestedCredentialData constructor.
37
     *
38
     * @param string $aaguid
39
     * @param string $credentialId
40
     * @param null|CBORObject $credentialPublicKey
41
     */
42
    public function __construct(string $aaguid, string $credentialId, ?CBORObject $credentialPublicKey)
43
    {
44
        $this->aaguid = $aaguid;
45
        $this->credentialId = $credentialId;
46
        $this->credentialPublicKey = $credentialPublicKey;
47
    }
48
49
    /**
50
     * @return string
51
     */
52
    public function getAaguid(): string
53
    {
54
        return $this->aaguid;
55
    }
56
57
    /**
58
     * @return string
59
     */
60
    public function getCredentialId(): string
61
    {
62
        return $this->credentialId;
63
    }
64
65
    /**
66
     * @return null|CBORObject
67
     */
68
    public function getCredentialPublicKey(): ?CBORObject
69
    {
70
        return $this->credentialPublicKey;
71
    }
72
}
73