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

RSA::getSupportedAlgorithms()   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 0
dl 0
loc 3
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace SimpleSAML\XMLSecurity\Alg\KeyTransport;
6
7
use SimpleSAML\XMLSecurity\Backend\OpenSSL;
8
use SimpleSAML\XMLSecurity\Constants as C;
9
use SimpleSAML\XMLSecurity\Key\AsymmetricKey;
10
11
/**
12
 * Class implementing the RSA key transport algorithms.
13
 *
14
 * @package simplesamlphp/xml-security
15
 */
16
final class RSA extends AbstractKeyTransporter
17
{
18
    /** @var string */
19
    protected string $default_backend = OpenSSL::class;
20
21
22
    /**
23
     * RSA constructor.
24
     *
25
     * @param \SimpleSAML\XMLSecurity\Key\AsymmetricKey $key The asymmetric key (either public or private) to use.
26
     * @param string $algId The identifier of this algorithm.
27
     */
28
    public function __construct(AsymmetricKey $key, string $algId = C::KEY_TRANSPORT_OAEP_MGF1P)
29
    {
30
        parent::__construct($key, $algId);
31
    }
32
33
34
    /**
35
     * @inheritDoc
36
     */
37
    public static function getSupportedAlgorithms(): array
38
    {
39
        return C::$KEY_TRANSPORT_ALGORITHMS;
40
    }
41
}