Skip to content

Commit 39f6d38

Browse files
committed
refactor(certificado): retorna o uso do PrivateKey devido a impossibilidade de testar a alteração realizada para GetRSAPrivateKey
1 parent acf2cbd commit 39f6d38

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

DFe.Utils/Assinatura/CertificadoDigital.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ private static void DefinirPinParaChavePrivada(this X509Certificate2 certificado
153153
if (Environment.OSVersion.Platform == PlatformID.Win32NT || Environment.OSVersion.Platform == PlatformID.Win32Windows || Environment.OSVersion.Platform == PlatformID.Win32S)
154154
{
155155
if (certificado == null) throw new ArgumentNullException("certificado");
156-
var key = (RSACryptoServiceProvider)certificado.GetRSAPrivateKey();
156+
var key = (RSACryptoServiceProvider)certificado.PrivateKey;
157157

158158
var providerHandle = IntPtr.Zero;
159159
var pinBuffer = Encoding.ASCII.GetBytes(pin);
@@ -338,7 +338,7 @@ public static bool IsA3(this X509Certificate2 x509Certificate2)
338338

339339
try
340340
{
341-
RSACryptoServiceProvider service = x509Certificate2.GetRSAPrivateKey() as RSACryptoServiceProvider;
341+
RSACryptoServiceProvider service = x509Certificate2.PrivateKey as RSACryptoServiceProvider;
342342

343343
if (service != null)
344344
{

0 commit comments

Comments
 (0)