Pass PIN
This commit is contained in:
@ -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));
|
||||
|
||||
Reference in New Issue
Block a user