From 96b8d60e5f1f1dec47a414199f4cc246487339f8 Mon Sep 17 00:00:00 2001 From: Maks3w Date: Tue, 5 Nov 2013 15:49:52 +0100 Subject: [PATCH] Tiny code style rewrite --- src/FR3D/XmlDSig/Adapter/XmlseclibsAdapter.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/FR3D/XmlDSig/Adapter/XmlseclibsAdapter.php b/src/FR3D/XmlDSig/Adapter/XmlseclibsAdapter.php index 2e13881..bbee125 100644 --- a/src/FR3D/XmlDSig/Adapter/XmlseclibsAdapter.php +++ b/src/FR3D/XmlDSig/Adapter/XmlseclibsAdapter.php @@ -156,15 +156,15 @@ public function verify(DOMDocument $data) if (!$this->getPublicKey()) { // try to get the public key from the certificate $objKey = $objXMLSecDSig->locateKey(); - if ($objKey) { - XMLSecEnc::staticLocateKeyInfo($objKey, $objDSig); - $this->publicKey = $objKey->getX509Certificate(); - $this->keyAlgorithm = $objKey->getAlgorith(); - } else { + if (!$objKey) { throw new RuntimeException( 'There is no set either private key or public key for signature verification.' ); } + + XMLSecEnc::staticLocateKeyInfo($objKey, $objDSig); + $this->publicKey = $objKey->getX509Certificate(); + $this->keyAlgorithm = $objKey->getAlgorith(); } if (!$objKey) {