in a short question: How can I fill in RSAParameters if I have having the following input from the third party?:
Modulus: 123456
Exponet: 111
In a long story, I use the following code:
RSACryptoServiceProvider RSAalg = new RSACryptoServiceProvider(2048);
RSAParameters rsaPublic = RSAalg.ExportParameters(false);
then I can get modulus and exponent of the rsa public key in byte[]. In order to write these information in the asn.1 format
RSAPublicKey ::= SEQUENCE {
modulus INTEGER, -- n
publicExponent INTEGER -- e
}
I use a asn.1 library to convert byte[] to its bigInteger format, but this byte[] should be in the format like {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9'} assuming it is decimal.
But it seems like rsaPublic.modulus and rsaPublic.exponent are not in this format, there are many not-digits in the byte[] of the modulus and exponent. So what is the format of rsaPublic.modulus and rsaPublic.exponent, and how convert them into a byte[] with the format like {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9'}?
Thanks a lot