Skip to content

Commit a640478

Browse files
committed
Remove unnecessary SignableElementTrait
1 parent 70e84a6 commit a640478

3 files changed

Lines changed: 6 additions & 49 deletions

File tree

src/XML/SignableElementTrait.php

Lines changed: 0 additions & 44 deletions
This file was deleted.

tests/XML/CustomSignable.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
use SimpleSAML\XML\Exception\MissingElementException;
1313
use SimpleSAML\XML\Exception\TooManyElementsException;
1414
use SimpleSAML\XMLSecurity\XML\SignableElementInterface;
15-
use SimpleSAML\XMLSecurity\XML\SignableElementTrait;
1615
use SimpleSAML\XMLSecurity\XML\SignedElementInterface;
1716
use SimpleSAML\XMLSecurity\XMLSecurityKey;
1817

@@ -21,8 +20,6 @@
2120
*/
2221
final class CustomSignable extends AbstractXMLElement implements SignableElementInterface
2322
{
24-
use SignableElementTrait;
25-
2623
/** @var string */
2724
public const NS = 'urn:oasis:names:tc:SAML:2.0:assertion';
2825

@@ -95,7 +92,12 @@ private function setElement(Chunk $elt): void
9592
*/
9693
public function sign(XMLSecurityKey $signingKey, array $certificates = []): SignedElementInterface
9794
{
98-
return CustomSigned::fromXML($this->toSignedXML($signingKey, $certificates));
95+
$unsigned = $this->toXML();
96+
97+
$signature = new Signature($signingKey->getAlgorithm(), $certificates, $signingKey);
98+
$signature->toXML($unsigned);
99+
100+
return $unsigned;
99101
}
100102

101103

tests/XML/CustomSignableTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
/**
1414
* Class \SimpleSAML\XMLSecurity\XML\CustomSignableTest
1515
*
16-
* @covers \SimpleSAML\XMLSecurity\XML\SignableElementTrait
1716
* @covers \SimpleSAML\XMLSecurity\Test\XML\CustomSignable
1817
*
1918
* @package simplesamlphp/xml-security

0 commit comments

Comments
 (0)