Failed Conditions
Push — v7 ( d5cb12...d36fb1 )
by Florent
02:58
created

PublicKey   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 0
dl 0
loc 34
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A create() 0 4 1
A getPoint() 0 4 1
1
<?php
2
3
/*
4
 * The MIT License (MIT)
5
 *
6
 * Copyright (c) 2014-2017 Spomky-Labs
7
 *
8
 * This software may be modified and distributed under the terms
9
 * of the MIT license.  See the LICENSE file for details.
10
 */
11
12
namespace Jose\Component\Core\Util\Ecc;
13
14
/*
15
 * *********************************************************************
16
 * Copyright (C) 2012 Matyas Danter
17
 *
18
 * Permission is hereby granted, free of charge, to any person obtaining
19
 * a copy of this software and associated documentation files (the "Software"),
20
 * to deal in the Software without restriction, including without limitation
21
 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
22
 * and/or sell copies of the Software, and to permit persons to whom the
23
 * Software is furnished to do so, subject to the following conditions:
24
 *
25
 * The above copyright notice and this permission notice shall be included
26
 * in all copies or substantial portions of the Software.
27
 *
28
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
29
 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
30
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
31
 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES
32
 * OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
33
 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
34
 * OTHER DEALINGS IN THE SOFTWARE.
35
 * ***********************************************************************
36
 */
37
38
/**
39
 * This class serves as public- private key exchange for signature verification.
40
 */
41
final class PublicKey
42
{
43
    /**
44
     * @var Point
45
     */
46
    private $point;
47
48
    /**
49
     * PublicKey constructor.
50
     *
51
     * @param Point $point
52
     */
53
    private function __construct(Point $point)
54
    {
55
        $this->point = $point;
56
    }
57
58
    /**
59
     * @param Point $point
60
     * @return PublicKey
61
     */
62
    public static function create(Point $point): PublicKey
63
    {
64
        return new self($point);
65
    }
66
67
    /**
68
     * @return Point
69
     */
70
    public function getPoint(): Point
71
    {
72
        return $this->point;
73
    }
74
}
75