Skip to content

Commit c9a2951

Browse files
jaimepereztvdijen
authored andcommitted
Add a method to SignatureAlgorithm to get the key
Signed-off-by: Jaime Pérez <jaimepc@gmail.com>
1 parent 40658ba commit c9a2951

3 files changed

Lines changed: 18 additions & 1 deletion

File tree

src/Alg/Signature/AbstractSigner.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,15 @@ public function getDigest(): string
7878
}
7979

8080

81+
/**
82+
* @return AbstractKey
83+
*/
84+
public function getKey(): AbstractKey
85+
{
86+
return $this->key;
87+
}
88+
89+
8190
/**
8291
* @param \SimpleSAML\XMLSecurity\Backend\SignatureBackend $backend
8392
*/

src/Alg/SignatureAlgorithm.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace SimpleSAML\XMLSecurity\Alg;
44

55
use SimpleSAML\XMLSecurity\Backend\SignatureBackend;
6+
use SimpleSAML\XMLSecurity\Key\AbstractKey;
67

78
/**
89
* An interface representing algorithms that can be used for digital signatures.
@@ -35,6 +36,13 @@ public function getDigest(): string;
3536
public function getAlgorithmId(): string;
3637

3738

39+
/**
40+
* Get the key to use with this signature algorithm.
41+
*
42+
* @return AbstractKey
43+
*/
44+
public function getKey(): AbstractKey;
45+
3846

3947
/**
4048
* Set the backend to use for actual computations by this algorithm.

src/Backend/HMAC.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public function sign(AbstractKey $key, string $plaintext): string
6262
/**
6363
* Verify a signature with this cipher and a given key.
6464
*
65-
* @param \SimpleSAML\XMLSecurity\Key\AbstractKey $key The key to use to.
65+
* @param \SimpleSAML\XMLSecurity\Key\AbstractKey $key The key to use to verify the signature.
6666
* @param string $plaintext The original signed text.
6767
* @param string $signature The (binary) signature to verify.
6868
*

0 commit comments

Comments
 (0)