Note that there are some explanatory texts on larger screens.

plurals
  1. POMoved asp.net site to new server, getting "Key not valid for use in specified state." error
    primarykey
    data
    text
    <p>I have set up a brand new, clean server to run our asp.net 4 website on. I have copied over the wwwroot folder from one of the existing servers, imported the configuration, and imported pfx file from the "old" server.</p> <p>Our website contains a shopping cart and during the payment portion of the cart process on this new server it throws the following error:</p> <pre>[CryptographicException: Key not valid for use in specified state.] System.Security.Cryptography.ProtectedData.Unprotect(Byte[] encryptedData, Byte[] optionalEntropy, DataProtectionScope scope) +374 Microsoft.Practices.EnterpriseLibrary.Security.Cryptography.ProtectedKey.Unprotect() +15 Microsoft.Practices.EnterpriseLibrary.Security.Cryptography.SymmetricCryptographer.Decrypt(Byte[] encryptedText) +66 Microsoft.Practices.EnterpriseLibrary.Security.Cryptography.SymmetricAlgorithmProvider.Decrypt(Byte[] ciphertext) +187 Microsoft.Practices.EnterpriseLibrary.Security.Cryptography.Cryptographer.DecryptSymmetric(String symmetricInstance, Byte[] ciphertext) +114 Microsoft.Practices.EnterpriseLibrary.Security.Cryptography.Cryptographer.DecryptSymmetric(String symmetricInstance, String ciphertextBase64) +73 CompanyName.Objects.BasePayment.get_PaymentNumberLastFour() +17 [TargetInvocationException: Property accessor 'PaymentNumberLastFour' on object 'CompanyName.Objects.Payment' threw the following exception:'Key not valid for use in specified state.</pre> <p>The code has not changed, its the same code on the other web server so I'm assuming it has something to do with the machinekeys. I have tried removing the rsa keys from the application data folder but to no avail. I'm not very familiar with cryptography in asp.net so its probably something I'm missing.</p> <p>Anyone have any ideas?<br> Thanks.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload