Issues (88)

src/Alg/Signature/HMAC.php (1 issue)

Labels
Severity
1
<?php
2
3
declare(strict_types=1);
4
5
namespace SimpleSAML\XMLSecurity\Alg\Signature;
6
7
use SimpleSAML\XMLSecurity\Backend;
8
use SimpleSAML\XMLSecurity\Constants as C;
9
use SimpleSAML\XMLSecurity\Key\SymmetricKey;
10
11
/**
12
 * Class implementing the HMAC signature algorithm
13
 *
14
 * @package simplesamlphp/xml-security
15
 */
16
final class HMAC extends AbstractSigner implements SignatureAlgorithmInterface
0 ignored issues
show
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...
17
{
18
    /** @var string */
19
    protected const DEFAULT_BACKEND = Backend\HMAC::class;
20
21
22
    /**
23
     * HMAC constructor.
24
     *
25
     * @param \SimpleSAML\XMLSecurity\Key\SymmetricKey $key The symmetric key to use.
26
     * @param string $algId The identifier of this algorithm.
27
     */
28
    public function __construct(
29
        #[\SensitiveParameter]
30
        SymmetricKey $key,
31
        string $algId = C::SIG_HMAC_SHA256,
32
    ) {
33
        parent::__construct($key, $algId, C::$HMAC_DIGESTS[$algId]);
34
    }
35
36
37
    /**
38
     * @return string[]
39
     */
40
    public static function getSupportedAlgorithms(): array
41
    {
42
        return array_keys(C::$HMAC_DIGESTS);
43
    }
44
}
45