in c#, when I use
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:
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.modul us and rsaPublic.expon ent are not in this format,
So what is the format of rsaPublic.modul us and rsaPublic.expon ent, and how convert them into a byte[] with the format like {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9'}?
Thanks very much
Code:
RSACryptoServiceProvider RSAalg = new RSACryptoServiceProvider(2048);
RSAParameters rsaPublic = RSAalg.ExportParameters(false);
Code:
RSAPublicKey ::= SEQUENCE {
modulus INTEGER, -- n
publicExponent INTEGER -- e
}
But it seems like rsaPublic.modul us and rsaPublic.expon ent are not in this format,
So what is the format of rsaPublic.modul us and rsaPublic.expon ent, and how convert them into a byte[] with the format like {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9'}?
Thanks very much