COSE-encoding a publickey

170 views
Skip to first unread message

Arun Sudhir

unread,
Dec 2, 2019, 5:34:01 PM12/2/19
to FIDO Dev (fido-dev)
I'm trying to build a FIDO2 client. As part of the FIDO2 registration process, I'm trying to generate the client payload to send to the FIDO2 server. For the authData structure,  https://medium.com/@herrjemand/verifying-fido2-responses-4691288c8770  has the split up of how it is populated, but has no details on the COSEencoded publickey. I have an RSA publickey. Can someone tell me how to coseencode it?
 
Should i make a CBOR map with fields "n" and "E" that stores the modulus and exponent respectively?

Thanks
Arun

Alex Seigler

unread,
Dec 2, 2019, 5:58:13 PM12/2/19
to Arun Sudhir, FIDO Dev (fido-dev)
There are some samples here:
List of assignments can be found here:

-aseigler

From: fido...@fidoalliance.org <fido...@fidoalliance.org> on behalf of Arun Sudhir <aruns...@gmail.com>
Sent: Monday, December 2, 2019 5:33:46 PM
To: FIDO Dev (fido-dev) <fido...@fidoalliance.org>
Subject: [FIDO-DEV] COSE-encoding a publickey
 
--
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 view this discussion on the web visit https://groups.google.com/a/fidoalliance.org/d/msgid/fido-dev/CABKFgsU_g3N3BL7rrwrsMBznRUzgD5T%3Dnob%2Bjf_Aa91bKrBiWw%40mail.gmail.com.

Arun Sudhir

unread,
Dec 2, 2019, 7:07:41 PM12/2/19
to Alex Seigler, FIDO Dev (fido-dev)
Thanks Alex. After looking those up my RSA public key would be cbor map that looks like:

"1" : "3"                                          //kty = 3 for RSA as per https://tools.ietf.org/html/rfc8152#page-34 for label and https://www.iana.org/assignments/cose/cose.xhtml#key-type for value
"3" : "-257"                                    //alg: RS256 as per  https://tools.ietf.org/html/rfc8152#page-34 for label and  https://www.iana.org/assignments/cose/cose.xhtml#algorithms for value
"-1" : <binary modulus value>      // as per https://www.iana.org/assignments/cose/cose.xhtml#key-type-parameters 
"-2" : <binary exponent value>    //again as per https://www.iana.org/assignments/cose/cose.xhtml#key-type-parameters 

Does this  make sense?

Thanks
Arun



--

Alex Seigler

unread,
Dec 2, 2019, 7:43:17 PM12/2/19
to Arun Sudhir, FIDO Dev (fido-dev)
Looks about right to me, but typically displayed without the quotes.

-aseigler 


From: Arun Sudhir <aruns...@gmail.com>
Sent: Monday, December 2, 2019, 7:07 PM
To: Alex Seigler
Cc: FIDO Dev (fido-dev)
Subject: Re: [FIDO-DEV] COSE-encoding a publickey

Arun Sudhir

unread,
Dec 2, 2019, 9:54:16 PM12/2/19
to Alex Seigler, FIDO Dev (fido-dev)
Thanks Alex!
Reply all
Reply to author
Forward
0 new messages