I'm trying to use existing public/private keys in C# and am getting nowhere. I can create new keys in C#, save them, and re-import them fine.
My old system is in Java, so I created some code to export the keys into the XML format that C# expects. From what I've read, C# expects the keys to be binary strings that have been BASE64 encoded. My Java code grabs the key parameters in binary format, then encodes them and creates the XML files. When I read the XML files into C#, it fails because of "Bad Data".
Has anyone done this before, or able to see what I'm doing wrong?
Thanks! -Nate
I've included (hopefully) all the relevant code/information below:
at System.Security.Cryptography.DSACryptoServiceProvider._ImportKey(IntPtr hCSP, Int32 algid, DSACspObject data) at System.Security.Cryptography.DSACryptoServiceProvider.ImportParameters(D SAParameters parameters) at System.Security.Cryptography.DSA.FromXmlString(String xmlString) at VerifyLicense() in executioner.cs:line 111
*********************** C# Code *********************** StreamReader re = new StreamReader(keyStream); string xmlString = re.ReadToEnd();
// Everything looks fine when I pump the xmlString out to the console Console.WriteLine(xmlString);
DSACryptoServiceProvider crypt = new DSACryptoServiceProvider();
// Fails on this next line crypt.FromXmlString(xmlString);
I have used CAPICOM with public/private key pairs (enveloping and signing). I generated the keys first with OpenSSL. But my client and server were both Win32 apps, for Java I think there is one additional hoop you must jump thru.
I think you will want to check out the CAPICOM e'list for info on using CAPICOM, there are a lot of sharp guys who do nothing but this kind of thing.
For 1.0 of the Framework, the WSDK has some additional key functionality so you might not need CAPICOM (but I have not tried it yet). I don't know what 1.1 has yet.
hth
---orig
I'm trying to use existing public/private keys in C# and am getting nowhere. I can create new keys in C#, save them, and re-import them fine. [snip]
-----Original Message----- From: SteveC [mailto:stevec@ATOMIC9.NET] Sent: Sunday, 4 May 2003 9:42 AM To: ADVANCED-DOTNET@DISCUSS.DEVELOP.COM Subject: [ADVANCED-DOTNET] re Using existing public/private keys in C#
I have used CAPICOM with public/private key pairs (enveloping and signing). I generated the keys first with OpenSSL. But my client and server were both Win32 apps, for Java I think there is one additional hoop you must jump thru.
I think you will want to check out the CAPICOM e'list for info on using CAPICOM, there are a lot of sharp guys who do nothing but this kind of thing.
For 1.0 of the Framework, the WSDK has some additional key functionality so you might not need CAPICOM (but I have not tried it yet). I don't know what 1.1 has yet.
hth
---orig
I'm trying to use existing public/private keys in C# and am getting nowhere. I can create new keys in C#, save them, and re-import them fine. [snip]
S11223J2 Currently, Timberland is one of the most famous Timberland Classic brands. Throughout the 1990s, the popularity of the Timberland Kids Boot reached an important point. Also, in that time, the company added more mens Timberland 6 Inch products and lines to its catalog. Now, the prestige as a Timberland custom boots brand with excellent products is unquestionable. In preparation for the upcoming cold seasons, the company has launched its collection called Timberland Women's Boots, which is already available at the Timberland stores. http://www.timberlander.com/products_all.html
If you would like to report an abuse of our service, such as a spam message, please . Если Вы хотите пожаловаться на содержимое этой страницы, пожалуйста .