AuthenticatorAssertionResponse::getSignature()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
1
<?php
2
3
namespace MadWizard\WebAuthn\Dom;
4
5
use MadWizard\WebAuthn\Format\ByteBuffer;
6
7
final class AuthenticatorAssertionResponse extends AbstractAuthenticatorResponse implements AuthenticatorAssertionResponseInterface
8
{
9
    /**
10
     * @var ByteBuffer
11
     */
12
    private $authenticatorData;
13
14
    /**
15
     * @var ByteBuffer
16
     */
17
    private $signature;
18
19
    /**
20
     * @var ByteBuffer|null
21
     */
22
    private $userHandle;
23
24 19
    public function __construct(string $clientDataJson, ByteBuffer $authenticatorData, ByteBuffer $signature, ?ByteBuffer $userHandle)
25
    {
26 19
        parent::__construct($clientDataJson);
27 14
        $this->authenticatorData = $authenticatorData;
28 14
        $this->signature = $signature;
29 14
        $this->userHandle = $userHandle;
30 14
    }
31
32 13
    public function getAuthenticatorData(): ByteBuffer
33
    {
34 13
        return $this->authenticatorData;
35
    }
36
37 6
    public function getSignature(): ByteBuffer
38
    {
39 6
        return $this->signature;
40
    }
41
42 12
    public function getUserHandle(): ?ByteBuffer
43
    {
44 12
        return $this->userHandle;
45
    }
46
47 11
    public function asAssertionResponse(): AuthenticatorAssertionResponseInterface
48
    {
49 11
        return $this;
50
    }
51
}
52