RSA::getSupportedAlgorithms()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace SimpleSAML\XMLSecurity\Alg\Signature;
6
7
use SimpleSAML\XMLSecurity\Constants as C;
8
use SimpleSAML\XMLSecurity\Key\AsymmetricKey;
9
10
/**
11
 * Class implementing the RSA signature algorithm.
12
 *
13
 * @package simplesamlphp/xml-security
14
 */
15
final class RSA extends AbstractSigner implements SignatureAlgorithmInterface
0 ignored issues
show
Bug introduced by
The type SimpleSAML\XMLSecurity\A...ignature\AbstractSigner was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
16
{
17
    /**
18
     * RSA constructor.
19
     *
20
     * @param \SimpleSAML\XMLSecurity\Key\AsymmetricKey $key The asymmetric key (either public or private) to use.
21
     * @param string $algId The identifier of this algorithm.
22
     */
23
    public function __construct(
24
        #[\SensitiveParameter]
25
        AsymmetricKey $key,
26
        string $algId = C::SIG_RSA_SHA256,
27
    ) {
28
        parent::__construct($key, $algId, C::$RSA_DIGESTS[$algId]);
29
    }
30
31
32
    /**
33
     * @return string[]
34
     */
35
    public static function getSupportedAlgorithms(): array
36
    {
37
        return array_keys(C::$RSA_DIGESTS);
38
    }
39
}
40