<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">
Thank you for the information and discussion, Anders, Bernd and Mike. I had a better understand of JOSE/COSE and the problems.
<div class=""><br class="">
</div>
<div class="">For the crypto implementation, for example Ed25519 in the SunEC provider, I would prefer to keep the footprint in OpenJDK as minimal as possible. For example, the Ed25519 key factory could accept XECPublicKeySpec and XECPrivateKeySpec only, and
support no more encoding format (currently, X509EncodedKeySpec and PKCS8EncodedKeySpec are also supported by the SunEC provider). Except COSE/JOSE/PEM, there may be a few other known encoding formats, and more in the future. It would be challenging to track
many encoding formats in specific protocols and their development in OpenJDK. If a provider does not support protocol specific format, the application rely on it could fail, which is not good for application developers. And thus the purpose to support more
encoding format in one provider could be frangible.</div>
<div class=""><br class="">
</div>
<div class="">There could be third party's encoding format specific provider, for example a KeyFactory provider accepting JOSE/COSE format and converting between XECPublicKeySpec/XECPrivateKeySpec and protocol specific formats. The factory might belong more
to the protocol specific library, rather than the OpenJDK reference implementation. Unfortunately, the current KeyFactory.getInstance(“ Ed25519”) design cannot identify the encoding formats, and thus may just return a provider that does not support the expected
encoding format. It might be a workaround to use different algorithm name, like “JOSE/Ed25519”.</div>
<div class=""><br class="">
</div>
<div class="">Alternatively, the JOSE/COSE could transfer the encoded stream to XECPublicKeySpec and XECPrivateKeySpec, without using KeyFactory. It may be transparent to application developers if the transferring is wrapped in the protocol specific lib.</div>
<div class=""><br class="">
</div>
<div class="">Just my $.02.</div>
<div class=""><br class="">
</div>
<div class="">Xuelei</div>
<div class=""><span style="font-family: Menlo; font-size: 11px;" class=""> </span>
<div><br class="">
<blockquote type="cite" class="">
<div class="">On Mar 28, 2022, at 2:30 AM, Bernd Eckenfels <<a href="mailto:ecki@zusammenkunft.net" class="">ecki@zusammenkunft.net</a>> wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div class="">
<div dir="ltr" class="">
<div class=""></div>
<div class="">
<div dir="ltr" class="">Hello,</div>
<div dir="ltr" class=""><br class="">
</div>
<div dir="ltr" class="">I think both might be too protocol specific to include it in JCE, but a library for JWK would fit into JWT support in Jakarta EE.</div>
<div dir="ltr" class=""><br class="">
</div>
<div dir="ltr" class=""> For COSE the key descriptors are very simple (no certificates), not sure if anything besides a cose library is really needed. (That library would benefit from a curve registry, but since cose uses its own code values for the curve access
to the CurveDB would not help I think).</div>
<div dir="ltr" class=""><br class="">
</div>
<div dir="ltr" class="">CBOR is not QR specific, it’s specific for the Covid Vaccination Certificate framework (due to the QR code size restriction it can’t use JSON).</div>
<div dir="ltr" class=""><br class="">
</div>
<div dir="ltr" class="">Gruss</div>
<div dir="ltr" class="">Bernd</div>
<div id="ms-outlook-mobile-signature" class="">
<div style="direction:ltr" class="">-- </div>
<div style="direction:ltr" class=""><a href="http://bernd.eckenfels.net" class="">http://bernd.eckenfels.net</a></div>
</div>
</div>
</div>
<hr style="display:inline-block;width:98%" tabindex="-1" class="">
<div id="divRplyFwdMsg" dir="ltr" class=""><font face="Calibri, sans-serif" style="font-size:11pt" class=""><b class="">Von:</b> Anthony Scarpino <<a href="mailto:anthony.scarpino@oracle.com" class="">anthony.scarpino@oracle.com</a>><br class="">
<b class="">Gesendet:</b> Monday, March 28, 2022 6:31:29 AM<br class="">
<b class="">An:</b> Anders Rundgren <<a href="mailto:anders.rundgren.net@gmail.com" class="">anders.rundgren.net@gmail.com</a>><br class="">
<b class="">Cc:</b> Bernd Eckenfels <<a href="mailto:ecki@zusammenkunft.net" class="">ecki@zusammenkunft.net</a>>;
<a href="mailto:security-dev@openjdk.java.net" class="">security-dev@openjdk.java.net</a> <<a href="mailto:security-dev@openjdk.java.net" class="">security-dev@openjdk.java.net</a>><br class="">
<b class="">Betreff:</b> Re: [Internet]Re: "Pluggable" key serialization in JCE/JCA</font>
<div class=""> </div>
</div>
<div class="BodyFragment"><font size="2" class=""><span style="font-size:11pt;" class="">
<div class="PlainText">Thanks for all the info. We don’t have experience with JOSE or COSE, I think we need to digest some of this data before making a future step
<br class="">
<br class="">
Not knowing this technology until you brought it up a few days ago, a few questions i have are how is this used and how common? Would I see this used for more secure sites like banks or shopping through the browser or it more common sites. Is it only browser-based
or are their other used cases? Bernd mentioned QR codes, is COSE used inside the QR code or the authentication for the user to get to their QR code?<br class="">
<br class="">
Thanks<br class="">
<br class="">
Tony<br class="">
<br class="">
> On Mar 26, 2022, at 11:48 PM, Anders Rundgren <<a href="mailto:anders.rundgren.net@gmail.com" class="">anders.rundgren.net@gmail.com</a>> wrote:<br class="">
> <br class="">
> On 2022-03-26 23:14, Bernd Eckenfels wrote:<br class="">
>> Just for completeness, the standard for key transport in JOSE is JWK (RFC7517).<br class="">
>> In COSE it is a COSE_Key(Set) as defined in RFC8152 sect13.<br class="">
>> BTW the most widely used CBOR/COSE application are probably the QR codes around Covid and Vaccination certificates of the EU.<br class="">
> <br class="">
> Thanx Bernd and Michael for the additional clarifications!<br class="">
> <br class="">
> Now to the thing that spurred this discussion: <a href="https://datatracker.ietf.org/doc/html/rfc8037" class="">
https://datatracker.ietf.org/doc/html/rfc8037</a><br class="">
> <br class="">
> This document defines how to use the Diffie-Hellman algorithms<br class="">
> "X25519" and "X448" as well as the signature algorithms "Ed25519" and<br class="">
> "Ed448" from the IRTF CFRG elliptic curves work in JSON Object<br class="">
> Signing and Encryption (JOSE).<br class="">
> <br class="">
> When RFC 8037 was created the assumption was that the "OKP" key container {sh|c}ould be used for other crypto systems having the same parameter set. This is now an active proposal:<br class="">
> <a href="https://www.ietf.org/archive/id/draft-looker-cose-bls-key-representations-00.html" class="">
https://www.ietf.org/archive/id/draft-looker-cose-bls-key-representations-00.html</a><br class="">
> <br class="">
> Obviously everything works just fine if you look at the container in isolation. However, it means that "OKP" encoder/decoder code must be updated for every new reuse ("overloading"). To be meaningful these new algorithms would also have to coerced into the
existing XEC or EdDSA interfaces.<br class="">
> <br class="">
> IMO, this would be VERY UNFORTUNATE since it is incompatible with the provider concept as well as with object oriented crypto APIs. I'm therefore suggesting that key containers for specific crypto systems should have unique names. In this particular case
"BLS" seems logical. In Java it could eventually be mapped to BLSPublicKey and BLSPrivateKey.<br class="">
> <br class="">
> WDYT?<br class="">
> <br class="">
> There is no need for a JEP at this stage, only some kind of indication of what the JDK crypto team see as the best way forward from your horizon. The same discussion has emerged for Post Quantum Crypto algorithms.<br class="">
> <br class="">
> Thanx,<br class="">
> Anders<br class="">
</div>
</span></font></div>
</div>
</div>
</blockquote>
</div>
<br class="">
</div>
</body>
</html>