From e27cd6f0bc82aedcc65e0f9bc9277a8cd254f24e Mon Sep 17 00:00:00 2001 From: Ahmad Syamim Date: Wed, 22 Jun 2022 23:04:51 +0900 Subject: [PATCH 1/3] Update XMLSecurityDSig.php --- src/XMLSecurityDSig.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/XMLSecurityDSig.php b/src/XMLSecurityDSig.php index 16713ab..0a3f98b 100644 --- a/src/XMLSecurityDSig.php +++ b/src/XMLSecurityDSig.php @@ -631,6 +631,7 @@ private function addRefInternal($sinfoNode, $node, $algorithm, $arTransforms=nul $id_name = 'Id'; $overwrite_id = true; $force_uri = false; + $uri_value = null; if (is_array($options)) { $prefix = empty($options['prefix']) ? null : $options['prefix']; @@ -638,6 +639,7 @@ private function addRefInternal($sinfoNode, $node, $algorithm, $arTransforms=nul $id_name = empty($options['id_name']) ? 'Id' : $options['id_name']; $overwrite_id = !isset($options['overwrite']) ? true : (bool) $options['overwrite']; $force_uri = !isset($options['force_uri']) ? false : (bool) $options['force_uri']; + $uri_value = empty($options['uri_value']) ? null : $options['uri_value']; } $attname = $id_name; @@ -659,7 +661,7 @@ private function addRefInternal($sinfoNode, $node, $algorithm, $arTransforms=nul } $refNode->setAttribute("URI", '#'.$uri); } elseif ($force_uri) { - $refNode->setAttribute("URI", ''); + $refNode->setAttribute("URI", $uri_value ?? ''); } $transNodes = $this->createNewSignNode('Transforms'); From a89dd8a3b06b3a70b5b706c531a3acb8270d2ada Mon Sep 17 00:00:00 2001 From: Ahmad Syamim Date: Wed, 29 Jun 2022 13:49:29 +0900 Subject: [PATCH 2/3] Update XMLSecurityDSig.php --- src/XMLSecurityDSig.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/XMLSecurityDSig.php b/src/XMLSecurityDSig.php index 0a3f98b..3830505 100644 --- a/src/XMLSecurityDSig.php +++ b/src/XMLSecurityDSig.php @@ -107,9 +107,16 @@ class XMLSecurityDSig /** * @param string $prefix */ - public function __construct($prefix='ds') + public function __construct($prefix='ds', $attributes=[]) { $template = self::BASE_TEMPLATE; + if (count($attributes)) { + foreach ($attributes as $a=>$v) { + $search = array("prefix = $prefix.':'; $search = array("$v) { + $search = array("prefix = $prefix.':';