Quantcast
Channel: Common Language Runtime Internals and Architecture forum
Viewing all articles
Browse latest Browse all 1710

CLR and RSA

$
0
0

Hi!

I have a problem: Trere is WinForm. This WinForm decrypts and encrypts text. I have made CLR with code from my WinForm (It's scalar function. It forms text and calls CLR for encrypt/decrypt text). But, when I call this function, I get error:

" A .NET Framework error occurred during execution of user-defined routine or aggregate "fn_fk1_getdata":   System.Security.Cryptography.CryptographicException: Key not valid for use in specified state.    System.Security.Cryptography.CryptographicException:     at System.Security.Cryptography.CryptographicException.ThrowCryptogaphicException(Int32 hr)     at System.Security.Cryptography.Utils._EncryptKey(SafeKeyHandle hPubKey, Byte[] key)     at System.Security.Cryptography.RSACryptoServiceProvider.Encrypt(Byte[] rgb, Boolean fOAEP)     at UserDefinedFunctions.fn_fk1_getdata(String xml, String url) " 

Public and private Keys keeps local. 

What can I correct this problem?

Many thanks for the answer

PS I apologize for my English


Viewing all articles
Browse latest Browse all 1710

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>