El TecnoBaúl de Kiquenet

Kiquenet boring stories

Posts Tagged ‘RSA’

Failed to decrypt using provider ‘RsaProtectedConfigurationProvider’

Posted by kiquenet en 19 mayo 2014

The error using ConfigurationManager and RsaProtectedConfigurationProvider section:

System.Configuration.ConfigurationErrorsException: Failed to decrypt using provider ‘RsaProtectedConfigurationProvider’. Error message from the provider: The RSA key container could not be opened.

The app.config file will have been encrypted using a certificate on your local machine. This certificate will not be present on the other machine. You will therefore not be able to decrypt the app.config file.

For this to work, you need to export the encryption key on your machine, then import it on the other machine. The following article demonstrates how to do that: Walkthrough: Creating and Exporting an RSA Key Container

This is the location where all of the keys are being put:

C:\Documents and Settings\All Users\Application Data\Microsoft\Crypto\RSA\MachineKeys


Using this command **aspnet_regiis -pa**

Open cmd Console -execute as Administrator-

    C:\Windows\system32>aspnet_regiis -pa "NetFrameworkConfigurationKey" "myDomain\myUser"
    Microsoft (R) ASP.NET RegIIS versión 4.0.30319.33440
    Utilidad de administración que instala y desinstala ASP.NET en el equipo local.
    Copyright (C) Microsoft Corporation. Todos los derechos reservados.
    Agregando ACL para el acceso al contenedor de claves RSA…
    Con éxito




More references:




Posted in .NET, Configuracion, Errores, Soporte | Etiquetado: , | Leave a Comment »