DUKPTFactory   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 6

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 4
lcom 0
cbo 6
dl 0
loc 34
ccs 8
cts 8
cp 1
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A createBDKFactory() 0 4 1
A createKSNFactory() 0 4 1
A createIPEKFactory() 0 4 1
A createDerivedKeyFactory() 0 4 1
1
<?php
2
/*
3
 * This file is part of the DUKPT package.
4
 *
5
 * Copyright (c) 2016-2017 Tonic Health <[email protected]>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
11
namespace TonicForHealth\DUKPT;
12
13
use TonicForHealth\DUKPT\Helper\Encryption\DESEncryptionHelper;
14
use TonicForHealth\DUKPT\Helper\Encryption\TripleDESEncryptionHelper;
15
use TonicForHealth\DUKPT\Key\BaseDerivationKeyFactory;
16
use TonicForHealth\DUKPT\Key\DerivedKeyFactory;
17
use TonicForHealth\DUKPT\Key\InitialPinEncryptionKeyFactory;
18
use TonicForHealth\DUKPT\Key\KeySerialNumberFactory;
19
20
/**
21
 * Class DUKPTFactory
22
 *
23
 * @author Vitalii Ekert <[email protected]>
24
 */
25
class DUKPTFactory
26
{
27
    /**
28
     * @return BaseDerivationKeyFactory
29
     */
30 2
    public function createBDKFactory()
31
    {
32 2
        return new BaseDerivationKeyFactory();
33
    }
34
35
    /**
36
     * @return KeySerialNumberFactory
37
     */
38 2
    public function createKSNFactory()
39
    {
40 2
        return new KeySerialNumberFactory();
41
    }
42
43
    /**
44
     * @return InitialPinEncryptionKeyFactory
45
     */
46 2
    public function createIPEKFactory()
47
    {
48 2
        return new InitialPinEncryptionKeyFactory(new TripleDESEncryptionHelper());
49
    }
50
51
    /**
52
     * @return DerivedKeyFactory
53
     */
54 2
    public function createDerivedKeyFactory()
55
    {
56 2
        return new DerivedKeyFactory(new DESEncryptionHelper());
57
    }
58
}
59