Issues (311)

src/XML/SignedElementInterface.php (2 issues)

Labels
Severity
1
<?php
2
3
declare(strict_types=1);
4
5
namespace SimpleSAML\XMLSecurity\XML;
6
7
use SimpleSAML\XMLSchema\Type\IDValue;
0 ignored issues
show
The type SimpleSAML\XMLSchema\Type\IDValue 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...
8
use SimpleSAML\XMLSecurity\Alg\Signature\SignatureAlgorithmInterface;
9
use SimpleSAML\XMLSecurity\Key\KeyInterface;
10
use SimpleSAML\XMLSecurity\XML\ds\Signature;
11
12
/**
13
 * An interface describing signed elements.
14
 *
15
 * @package simplesamlphp/xml-security
16
 */
17
interface SignedElementInterface extends CanonicalizableElementInterface
18
{
19
    /**
20
     * Get the ID of this element.
21
     *
22
     * When this method returns null, the signature created for this object will reference the entire document.
23
     *
24
     * @return \SimpleSAML\XML\Type\IDValue|null The ID of this element, or null if we don't have one.
0 ignored issues
show
The type SimpleSAML\XML\Type\IDValue 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...
25
     */
26
    public function getId(): ?IDValue;
27
28
29
    /**
30
     * Retrieve the signature in this object, if any.
31
     *
32
     * @return \SimpleSAML\XMLSecurity\XML\ds\Signature|null
33
     */
34
    public function getSignature(): ?Signature;
35
36
37
    /**
38
     * Retrieve the key used to verify the signature in this object.
39
     *
40
     * @return \SimpleSAML\XMLSecurity\Key\KeyInterface The key that verified the signature in this object.
41
     * @throws \Exception if an error occurs while trying to extract the public key from a certificate.
42
     */
43
    public function getVerifyingKey(): ?KeyInterface;
44
45
46
    /**
47
     * Whether this object is signed or not.
48
     */
49
    public function isSigned(): bool;
50
51
52
    /**
53
     * Verify the signature in this object.
54
     *
55
     * If no signature is present, false is returned. If a signature is present,
56
     * but cannot be verified, an exception will be thrown.
57
     *
58
     * @param \SimpleSAML\XMLSecurity\Alg\Signature\SignatureAlgorithmInterface|null $verifier The verifier to use to
59
     *  verify the signature. If null, attempt to verify it with the KeyInfo information in the signature.
60
     * @return \SimpleSAML\XMLSecurity\XML\SignedElementInterface The object processed again from its canonicalised
61
     *  representation verified by the signature.
62
     *
63
     * @throws \SimpleSAML\XMLSecurity\Exception\NoSignatureFoundException if the object is not signed.
64
     * @throws \SimpleSAML\XMLSecurity\Exception\InvalidArgumentException if no key is passed and there is no KeyInfo
65
     * in the signature.
66
     * @throws \SimpleSAML\XMLSecurity\Exception\RuntimeException if the signature fails to validate.
67
     */
68
    public function verify(?SignatureAlgorithmInterface $verifier = null): SignedElementInterface;
69
}
70