I have an RSA (x509 certificate) that I want to use in a C# program.
I've done some research and apparently I need to import two things using RSAParameters: The modulus, and the exponent.
All I know how to use is a key block like the one above, how do I take a key block and get the modulus and exponent? I tried MSDN but the documentation doesn't say much.
Also, those two fields are supposed to be in byte[]
format, can I convert them directly (I have a method Utility.ToByteArray()
) or do they need to be encoded in a certain way first.
Thanks!
Use openssl to get the modulus and exponent from an existing certificate file:
openssl x509 -in public.crt -text
This outputs something like the following: