what is the format of rsa public key modulus and exponent?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • travellover
    New Member
    • Feb 2010
    • 1

    what is the format of rsa public key modulus and exponent?

    in c#, when I use

    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:

    Code:
          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.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
Working...