<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[wolfSSL - Embedded SSL Library — Json WEB Key (JWK) RFC7517]]></title>
		<link>https://www.wolfssl.com/forums/topic2020-json-web-key-jwk-rfc7517.html</link>
		<atom:link href="https://www.wolfssl.com/forums/feed-rss-topic2020.xml" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in Json WEB Key (JWK) RFC7517.]]></description>
		<lastBuildDate>Tue, 27 Jun 2023 01:13:06 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Json WEB Key (JWK) RFC7517]]></title>
			<link>https://www.wolfssl.com/forums/post7175.html#p7175</link>
			<description><![CDATA[<p>I&#039;ve already done that in ECDSA with:</p><p>&nbsp; &nbsp; &nbsp; &nbsp; wc_ecc_export_public_raw(&amp; AccountKey, qx, &amp;qxlen,qy, &amp;qylen);</p><p>and the signature with:</p><p>&nbsp; &nbsp;&nbsp; mp_int ri; // destination for r component of signature.<br />&nbsp; &nbsp;&nbsp; mp_int si; // destination for s component of signature.<br />&nbsp; &nbsp;&nbsp; mp_init(&amp;ri); // initialize r component<br />&nbsp; &nbsp;&nbsp; mp_init(&amp;si); // initialize s component<br />&nbsp; &nbsp;&nbsp; wc_ret |= wc_ecc_sign_hash_ex(hash, hash_len,&amp;rng, &amp;AccountKey,&amp;ri,&amp;si);</p><p>&nbsp; &nbsp;&nbsp; uint8_t dbuf[64];<br />&nbsp; &nbsp;&nbsp; uint32_t rsiz=32;<br />&nbsp; &nbsp;&nbsp; uint32_t ssiz=32;</p><p>&nbsp; &nbsp;&nbsp; wc_export_int(&amp;ri,dbuf,(word32 *)&amp;rsiz,32,WC_TYPE_UNSIGNED_BIN);<br />&nbsp; &nbsp;&nbsp; wc_export_int(&amp;si,dbuf+32,(word32 *)&amp;ssiz,32,WC_TYPE_UNSIGNED_BIN);</p><p>Just did not want to duplicate work if you guys were going to build a library...<br />Making an ACME client work... its mostly working, just have to clean it up...</p>]]></description>
			<author><![CDATA[null@example.com (pbreed)]]></author>
			<pubDate>Tue, 27 Jun 2023 01:13:06 +0000</pubDate>
			<guid>https://www.wolfssl.com/forums/post7175.html#p7175</guid>
		</item>
		<item>
			<title><![CDATA[Re: Json WEB Key (JWK) RFC7517]]></title>
			<link>https://www.wolfssl.com/forums/post7174.html#p7174</link>
			<description><![CDATA[<p>Hi pbreed,</p><p>We do not directly support generating a JSON web key, but we do support generating keys, exporting their components and encoding them as base64.&nbsp; After following these steps, you will need to handle creating the JSON and adding the base64-encoded components to this JSON.</p><p>For RSA:<br />1)&nbsp; Generate an RSA key using wc_MakeRsaKey: <a href="https://www.wolfssl.com/documentation/manuals/wolfssl/group__RSA.html#function-wc_makersakey">https://www.wolfssl.com/documentation/m … makersakey</a><br />2)&nbsp; Export the RSA key using wc_RsaFlattenPublicKey (n/e only for public key) or wc_RsaExportKey (all components for public + private key): <a href="https://www.wolfssl.com/documentation/manuals/wolfssl/group__RSA.html#function-wc_rsaflattenpublickey">https://www.wolfssl.com/documentation/m … npublickey</a></p><p>For ECC:<br />1)&nbsp; Generate an ECC key using wc_ecc_make_key: <a href="https://www.wolfssl.com/documentation/manuals/wolfssl/group__ECC.html#function-wc_ecc_make_key">https://www.wolfssl.com/documentation/m … c_make_key</a><br />2)&nbsp; Export the ECC key using wc_ecc_export_public_raw/wc_ecc_export_private_raw.</p><p>Now base64 encode each component using Base64_Encode_NoNl: <a href="https://www.wolfssl.com/documentation/manuals/wolfssl/group__Base__Encoding.html#function-base64_encode_nonl">https://www.wolfssl.com/documentation/m … ncode_nonl</a></p><p>Then you will need to create the appropriate JSON and add these components.</p><p>Thanks,<br />Kareem</p>]]></description>
			<author><![CDATA[null@example.com (kareem_wolfssl)]]></author>
			<pubDate>Mon, 26 Jun 2023 23:27:09 +0000</pubDate>
			<guid>https://www.wolfssl.com/forums/post7174.html#p7174</guid>
		</item>
		<item>
			<title><![CDATA[Json WEB Key (JWK) RFC7517]]></title>
			<link>https://www.wolfssl.com/forums/post7173.html#p7173</link>
			<description><![CDATA[<p>IS there any support for converting between the wolf native keys and signatures and the formats<br />documented in this RFC?</p>]]></description>
			<author><![CDATA[null@example.com (pbreed)]]></author>
			<pubDate>Mon, 26 Jun 2023 22:51:54 +0000</pubDate>
			<guid>https://www.wolfssl.com/forums/post7173.html#p7173</guid>
		</item>
	</channel>
</rss>
