From 606b05ae76fb1fd90badb8237f9175c942117c35 Mon Sep 17 00:00:00 2001 From: "HOME-LAPTOP\\kshkulev" Date: Mon, 29 Sep 2025 11:36:20 +0900 Subject: [PATCH] Put signature into signed element --- Hcs.Broker/Api/Request/GostSigningMessageInspector.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Hcs.Broker/Api/Request/GostSigningMessageInspector.cs b/Hcs.Broker/Api/Request/GostSigningMessageInspector.cs index 2db1f26..dc1b7ae 100644 --- a/Hcs.Broker/Api/Request/GostSigningMessageInspector.cs +++ b/Hcs.Broker/Api/Request/GostSigningMessageInspector.cs @@ -2,7 +2,6 @@ using CryptoPro.Security.Cryptography.X509Certificates; using CryptoPro.Security.Cryptography.Xml; using Hcs.Broker.Internal; -using System.Security; using System.Security.Cryptography; using System.ServiceModel; using System.ServiceModel.Channels; @@ -146,8 +145,9 @@ namespace Hcs.Broker.Api.Request signedXml.ComputeXadesSignature(); + var element = doc.SelectNodes("//*[@Id='" + Constants.SIGNED_XML_ELEMENT_ID + "']")[0]; var xmlDigitalSignature = signedXml.GetXml(); - doc.DocumentElement.AppendChild(doc.ImportNode(xmlDigitalSignature, true)); + element.AppendChild(doc.ImportNode(xmlDigitalSignature, true)); if (doc.FirstChild is XmlDeclaration) {