<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Provisioning PSK at Manufacturing</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/122837/provisioning-psk-at-manufacturing</link><description>Hi, I&amp;#39;m working on provisioning a Pre-Shared Key (PSK) during manufacturing for an nRF5340 device. The device needs access to the PSK at runtime to generate authentication tokens with various nonces. 
 Setup: 
 
 Device: nRF5340 
 SDK: nRF Connect SDK</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 22 Jul 2025 08:13:55 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/122837/provisioning-psk-at-manufacturing" /><item><title>RE: Provisioning PSK at Manufacturing</title><link>https://devzone.nordicsemi.com/thread/543116?ContentTypeID=1</link><pubDate>Tue, 22 Jul 2025 08:13:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b54272c8-b5ed-49e2-954a-8933d3b28520</guid><dc:creator>hugzy123</dc:creator><description>&lt;p&gt;Thanks for the detailed explanation. This looks like it could fit our needs, I&amp;#39;ll investigate the TF-M provisioning approach you&amp;#39;ve outlined.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Provisioning PSK at Manufacturing</title><link>https://devzone.nordicsemi.com/thread/543099?ContentTypeID=1</link><pubDate>Tue, 22 Jul 2025 06:48:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f4baf76b-5802-47f5-9ed5-6ed05d347781</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;I am not an expert in this but think of your device’s KMU slots like a locked safe that you load up during manufacturing. When you run the TF-M provisioning image, it puts your Pre-Shared Key into that safe, and as long as you only flash your application code afterward without doing a full chip erase, everything inside the safe stays right where it belongs. Means, you can update your app as often as you like and the KMU will still hold your key properly.&lt;/p&gt;
&lt;p&gt;Behind the scenes, TF-M’s psa_import_key() call doesn’t just scribble your key onto flash; it tucks it away in Internal Trusted Storage (ITS) and then scrambles it with a Master Key Encryption Key (MKEK) that lives in the KMU. From your application’s point of view, it simply asks “Hey TF-M, give me handle #42” using psa_open_key(), and TF-M hands back a ticket to use the key without ever exposing your raw secret to the non-secure world. You get persistence across resets and firmware updates, plus hardware-backed confidentiality, all in one neat package.&lt;/p&gt;
&lt;p&gt;So at manufacturing you flash the provisioning image, feed it your PSK over UART or J-Link, let it import and encrypt your key behind TF-M, and then switch over to your regular firmware. From there on out, your app just opens the key handle whenever it needs to generate tokens or signatures, no MPU hacks, no UICR gymnastics, and no chance of accidentally wiping out that crucial secret. Your PSK stays secure yet always available for your authentication flows.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Provisioning PSK at Manufacturing</title><link>https://devzone.nordicsemi.com/thread/542616?ContentTypeID=1</link><pubDate>Wed, 16 Jul 2025 09:24:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7c965637-ac8e-4fc1-acc3-256070494f1f</guid><dc:creator>hugzy123</dc:creator><description>&lt;p&gt;Hi Susheel,&lt;br /&gt;&lt;br /&gt;Thanks for your reply.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;If I understand correctly you&amp;#39;re saying to implement something like&amp;nbsp;provisioning image example&amp;nbsp; and use a secure channel e.g UART connected to PC to receive the keys and then store the keys using the PSA crypto library. This provisioning image would be flashed before my application binary at manufacturing.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Won&amp;#39;t the KMU be overwritten when I flash the application binary after the TF-M provisioning image?&lt;/p&gt;
&lt;p&gt;When calling&amp;nbsp;&lt;span&gt;psa_import_key, is the key stored in persistent storage?&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Provisioning PSK at Manufacturing</title><link>https://devzone.nordicsemi.com/thread/542600?ContentTypeID=1</link><pubDate>Wed, 16 Jul 2025 06:00:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:dfb65f27-8e8f-4073-8d33-8b92b41a932b</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;Hi Benjamin,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The only supportable way to factory-provision per-device PSKs on nRF53 + TF-M is to use the TF-M provisioning image (psa_import_key over a secure channel) and then access them at runtime via the PSA Crypto API. All other hacks/workarounds like UICR, raw KMU writes from NS are either blocked by the MPU or leave you without a PSA handle. If you truely must use the KMU directly (which we do not recommend) then you still need a secure shim that calls psa_set_key_policy() and psa_import_key into that slot. Bypassing the TF-M provisioning image just moves the complexity into your own secure code.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Provisioning PSK at Manufacturing</title><link>https://devzone.nordicsemi.com/thread/542067?ContentTypeID=1</link><pubDate>Thu, 10 Jul 2025 09:13:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ab6e7222-3952-4225-af61-6304d3b9c750</guid><dc:creator>hugzy123</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;&lt;span&gt;Andreas,&lt;/span&gt;&lt;span&gt;&lt;br /&gt;&lt;br /&gt;I did look at&amp;nbsp;HUK&amp;nbsp;but thought it was unsuitable for our functionality - the PSK needs to fed into the device from an external PC (via Jlink) and also saved in our cloud for future device verification.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Are we able to write directly to the KMU from the PC and read in application code?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I&amp;#39;ve tried adapting the &lt;a href="https://github.com/nrfconnect/sdk-nrf/tree/main/samples/crypto/persistent_key_usage"&gt;persistent key usage sample&lt;/a&gt;&amp;nbsp;to &amp;quot;open&amp;quot; an existing key instead of generating new and writing the key using memwr commands in nrfjprog but psa_open_key fails.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Thanks,&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Provisioning PSK at Manufacturing</title><link>https://devzone.nordicsemi.com/thread/541942?ContentTypeID=1</link><pubDate>Wed, 09 Jul 2025 12:49:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:21e93ec9-c858-45f9-8a1c-95a8faa3f396</guid><dc:creator>AHaug</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;For NCS v2.5.3, the secure and recommended method is to use the TF-M provisioning image to inject PSKs and other secrets into secure storage at manufacturing time, disable dummy provisioning, and use the PSA Crypto API for all key access. This ensures that PSKs are never exposed outside the secure environment and are protected throughout the device lifecycle. This should set the HUK properly.&lt;/p&gt;
&lt;p&gt;If you need step-by-step details, refer to the &lt;a title="https://docs.nordicsemi.com/bundle/ncs-latest/page/nrf/security/tfm/tfm_provisioning.html" href="https://docs.nordicsemi.com/bundle/ncs-latest/page/nrf/security/tfm/tfm_provisioning.html" rel="noopener noreferrer" target="_blank"&gt;&lt;strong&gt;TF-M provisioning documentation&lt;/strong&gt;&lt;/a&gt; and the &lt;a title="https://docs.nordicsemi.com/bundle/ncs-latest/page/nrf/samples/tfm/provisioning_image/readme.html#provisioning-image" href="https://docs.nordicsemi.com/bundle/ncs-latest/page/nrf/samples/tfm/provisioning_image/README.html#provisioning-image" rel="noopener noreferrer" target="_blank"&gt;&lt;strong&gt;TF-M: Provisioning image sample&lt;/strong&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;br /&gt;Andreas&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>