Completed
Push — master ( 34f908...4c48cd )
by Florent
02:40
created

AuthenticatorAssertionResponse::jsonSerialize()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 12
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 7
nc 2
nop 0
dl 0
loc 12
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * The MIT License (MIT)
7
 *
8
 * Copyright (c) 2014-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
/**
17
 * @see https://www.w3.org/TR/webauthn/#authenticatorassertionresponse
18
 */
19
class AuthenticatorAssertionResponse extends AuthenticatorResponse
20
{
21
    private $authenticatorData;
22
23
    private $signature;
24
25
    private $userHandle;
26
27
    public function __construct(CollectedClientData $clientDataJSON, AuthenticatorData $authenticatorData, string $signature, ?string $userHandle)
28
    {
29
        parent::__construct($clientDataJSON);
30
        $this->authenticatorData = $authenticatorData;
31
        $this->signature = $signature;
32
        $this->userHandle = $userHandle;
33
    }
34
35
    public function getAuthenticatorData(): AuthenticatorData
36
    {
37
        return $this->authenticatorData;
38
    }
39
40
    public function getSignature(): string
41
    {
42
        return $this->signature;
43
    }
44
45
    public function getUserHandle(): ?string
46
    {
47
        return $this->userHandle;
48
    }
49
}
50