Archived Forum Post

Index of archived forum posts

Question:

RSA Chilkat to native .net

Oct 12 '15 at 12:40

Hi,

A couple of years ago we built a VB6 activeX component utilizing RSA encryption. Unfortunately for my dev team, IE is discontinuing support for ActiveX ;) And we need to rewrite this old code into something new.

Nowadays .Net has built in native Crypto libs and I'd prefer to use those over 3rd party components. We're stuck with converting the RSA key as I'm unsure how to interpret the Exponent part of the RSA key.

most of the RSA properties are base64 encoded and aren't a problem However the RSA key has this section: <exponent>xyz</exponent> how can we convert this xyz in the proper byte array which the .net RSAParameters.Exponent needs?

many thanks!

Bert


Answer

OK was able to figure it out

p.Exponent = Encoding.UTF8.GetBytes(doc.GetElementsByTagName("Exponent")[0].InnerText);