Skip to content

Commit 5037b9f

Browse files
committed
Add XmlSigner::setSignatureXPath
1 parent 2747691 commit 5037b9f

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ $xmlSigner->loadPfx('pfx content', 'password');
136136
$xmlSigner->setReferenceUri('');
137137

138138
// Define signature target
139-
$xmlSigner->setSignaturePath('/SOAP-ENV:Envelope/SOAP-ENV:Body/MyTargetElement');
139+
$xmlSigner->setSignatureXPath('/SOAP-ENV:Envelope/SOAP-ENV:Body/MyTargetElement');
140140

141141
$xmlSigner->signXml('the soap message xml', DigestAlgorithmType::SHA512);
142142
```

src/XmlSigner.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -467,7 +467,7 @@ public function setReferenceUri(string $referenceUri)
467467
*
468468
* @return void
469469
*/
470-
public function setSignaturePath(string $xpath)
470+
public function setSignatureXPath(string $xpath)
471471
{
472472
$this->signatureXpath = $xpath;
473473
}

tests/XmlSignatureTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ public function testSignAndVerifySoap(string $privateKeyFile, string $publicKeyF
142142
}
143143

144144
$signedXml->setReferenceUri('');
145-
$signedXml->setSignaturePath('/SOAP-ENV:Envelope/SOAP-ENV:Body/xmlns:RegisterTCRRequest');
145+
$signedXml->setSignatureXPath('/SOAP-ENV:Envelope/SOAP-ENV:Body/xmlns:RegisterTCRRequest');
146146
$signedXml->signXmlFile($filename, $outputFilename, $algo);
147147

148148
$this->assertFileExists($outputFilename);

0 commit comments

Comments
 (0)