Passed
Pull Request — master (#26)
by Jaime Pérez
02:00
created

TripleDES::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 3
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace SimpleSAML\XMLSecurity\Alg\Encryption;
6
7
use SimpleSAML\XMLSecurity\Backend\OpenSSL;
8
use SimpleSAML\XMLSecurity\Constants as C;
9
use SimpleSAML\XMLSecurity\Key\SymmetricKey;
10
11
/**
12
 * Class implementing the 3DES encryption algorithm.
13
 *
14
 * @package simplesamlphp/xml-security
15
 */
16
class TripleDES extends AbstractEncryptor
17
{
18
    /** @var string */
19
    protected string $default_backend = OpenSSL::class;
20
21
22
    /**
23
     * 3DES constructor.
24
     *
25
     * @param \SimpleSAML\XMLSecurity\Key\SymmetricKey $key The symmetric key to use.
26
     */
27
    public function __construct(SymmetricKey $key)
28
    {
29
        parent::__construct($key, C::BLOCK_ENC_3DES);
30
    }
31
32
33
    /**
34
     * @inheritDoc
35
     */
36
    public static function getSupportedAlgorithms(): array
37
    {
38
        return [C::BLOCK_ENC_3DES];
39
    }
40
}