RAW RSA public key

422 views
Skip to first unread message

Nischal Bansal

unread,
Dec 6, 2016, 6:07:32 PM12/6/16
to FIDO Dev (fido-dev)
Hi All,

Our generated public key is in following format.
RSA Public Key
            modulus: cf7b178b185cf25054112d60d9ecbe19d11938bebd923ecd691c460638f9b85169d8207322dcd991804ced155236df6ea19a0e9ec41550528a0cd9e027f6a33e064e23fffc68ebe0d9f8f4adcbdfce6ecfb11bc0f312e3c3fbcbbda2c69e0f01ab1de182a2b5da2a377cba25adb6e629b0a6bf23c4aa73291bc45db135b92af13f4b636f6b50e24f1c6428e2929687ced6293ea2c7863bff99f1e1eb11ec8cf2fa7c3a54f6c3f7d5a12c0deb6426a63efbea291d97a4c1f9490e69d3e81ed1f66a2ba76199f341225f04f5560f412bcf7a1ebfe03fdcb50aee56a6d03d9563bf769dd1acb94db58d2fe0a6a573f6aa1f13b3776013c71631189c34620166859f
    public exponent: 10001

But before including in assertion or writing in a file, we are encoding the public key using below command. Because we require a byte array to insert in assertion or writing in a file.
           byte[] pub = key.getEncoded();


Our metadata is submitted with RSA_RAW, but it seems our public key is converted in below PEM format
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA3O1-gGqUYD13y_L94XzcrRgJy458cLmKdxeXv7z1nMDEWi0REDCNFX1Uc80Al_AD7bsKAkh4cUXO1EaST12hr4IOw9fmt4H2ZkGPyqPUH0Tnhw8rSYt-yU22A-tHdab97ACxhLEIIJZWSOR90Q-OjjGm1dm9lT6ljASmF2Q4C__-U1KNf9LzxjYZV_6_U9nvYKPVtTk1O_6UgpX9YyIMOyuFPXlUgNdxDAJEpZeqhh6G3pi9jOoxufHQD7R6T1jYVQ9TeLGpUbjDDty1gZrwc4HRUlzN8hq-rF_K0GLRIoeWVhSDg7sDsCoV9OPuEpDhGwQxYi2lFGzG00fciIIsRQIDAQABPT0=

Anybody can confirm, if the above (Modulus and Exponent) mentioned public key is in RAW format and we have to send the same without encoding?
or please suggest, what's the format of the RAW Public Key and how can we send it?

Ka Yang

unread,
Dec 6, 2016, 7:54:57 PM12/6/16
to Nischal Bansal, FIDO Dev (fido-dev)
Not sure what exact implementation you used for your RSA public key class. But typically getEncoded returns the SubjectPublicKeyInfo, which is the same as the string that you shown.

According to the UAF spec, RSA RAW format is simply the concatenation of the modulus and the exponent.

FYI, here is what the spec states

UAF_ALG_KEY_RSA_2048_PSS_RAW 0x102
Raw encoded RSASSA-PSS public key [RFC3447].

The default parameters according to [RFC4055] MUST be assumed, i.e.

  • Mask Generation Algorithm MGF1 with SHA256
  • Salt Length of 32 bytes, i.e. the length of a SHA256 hash value.
  • Trailer Field value of 1, which represents the trailer field with hexadecimal value 0xBC.

That is, [n (256 bytes), e (N-n bytes)]. Where N is the total length of the field.

This total length should be taken from the object containing this key, e.g. the TLV encoded field.



--
You received this message because you are subscribed to the Google Groups "FIDO Dev (fido-dev)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fido-dev+u...@fidoalliance.org.
To post to this group, send email to fido...@fidoalliance.org.
Visit this group at https://groups.google.com/a/fidoalliance.org/group/fido-dev/.
To view this discussion on the web visit https://groups.google.com/a/fidoalliance.org/d/msgid/fido-dev/6e8d1e77-c23a-485f-98ff-71e0890804d0%40fidoalliance.org.

Reply all
Reply to author
Forward
0 new messages