Skip to content

Commit df435c2

Browse files
committed
Signable elements should call toXML()
We got rid of the initial extra toSignedXML() method. If we want to sign an element, we should just call sign() on it, then get the result with toXML(). This means it will be toXML() the method that actually does the signing, while sign() will simply prepare everything for it and signal that the element should be signed when calling toXML(). Signed-off-by: Jaime Pérez <jaimepc@gmail.com>
1 parent 20dd0c8 commit df435c2

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

src/XML/SignableElementInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public function getId(): ?string;
2727
/**
2828
* Sign the current element.
2929
*
30-
* @note The signature will not be applied until toSignedXML() is called.
30+
* @note The signature will not be applied until toXML() is called.
3131
*
3232
* @param \SimpleSAML\XMLSecurity\Alg\SignatureAlgorithm $signer The actual signer implementation to use.
3333
* @param string $canonicalizationAlg The identifier of the canonicalization algorithm to use.

src/XML/SignableElementTrait.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ abstract public function getId(): ?string;
6060
/**
6161
* Sign the current element.
6262
*
63-
* @note The signature will not be applied until toSignedXML() is called.
63+
* The signature will not be applied until toXML() is called.
6464
*
6565
* @param \SimpleSAML\XMLSecurity\Alg\SignatureAlgorithm $signer The actual signer implementation to use.
6666
* @param string $canonicalizationAlg The identifier of the canonicalization algorithm to use.

0 commit comments

Comments
 (0)