This commit is contained in:
2025-09-28 16:43:36 +09:00
parent 584e43bfa9
commit 3a2325aef8
2 changed files with 21 additions and 5 deletions

View File

@ -2,6 +2,7 @@
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;
@ -40,11 +41,15 @@ namespace Hcs.Broker.Api.Request
var xmlDocument = new XmlDocument();
xmlDocument.LoadXml(messageBody);
var provider = client.Certificate.PrivateKey as Gost3410_2012_256CryptoServiceProvider;
provider.SetContainerPassword(client.CertificatePin);
var signedXml = SignXmlFileXades(
xmlDocument,
client.Certificate,
client.Certificate.PrivateKey as Gost3410_2012_256CryptoServiceProvider,
CpSignedXml.XmlDsigGost3411_2012_256Url);
provider,
CpSignedXml.XmlDsigGost3411_2012_256Url,
false);
stopwatch.Stop();
@ -107,7 +112,7 @@ namespace Hcs.Broker.Api.Request
CpX509Certificate certificate,
AsymmetricAlgorithm key,
string digestMethod,
bool useDsPrefix = false)
bool useDsPrefix)
{
var keyInfo = new CpKeyInfo();
keyInfo.AddClause(new CpKeyInfoX509Data(certificate));