System.Security.Cryptography.CryptographicException: The system cannot find the file specified.
at System.Security.Cryptography.Utils.CreateProvHandle(CspParameters parameters, Boolean randomKeyContainer)
at System.Security.Cryptography.RSACryptoServiceProvider.ImportParameters(RSAParameters parameters)
at WebService.ted_signature.getRSA(String t)
at WebService.ted_signature.generar_firmar_ted(String contenido_a_firmar, String rsask)
at WebService.ted_xml.crear_ted(String nodo_caf, String rsask, String rut_emisor, String dte, String folio, String fecha_emision, String rut_receptor, String razon_social_receptor, String monto_total, String item1_detalle, String ts)
at WebService.Service1.firmar_xml(Byte[] f, Char ambiente)
solución: agregar en el código
Dim csp As CspParameters = New CspParameters()
'csp.Flags = CspProviderFlags.UseExistingKey
csp.Flags = CspProviderFlags.UseMachineKeyStore
Dim RSA As System.Security.Cryptography.RSACryptoServiceProvider = New System.Security.Cryptography.RSACryptoServiceProvider(1024, csp)
No hay comentarios.:
Publicar un comentario