<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: AN12812 - How to use CST with HSM in i.MX Processors</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/AN12812-How-to-use-CST-with-HSM/m-p/1792824#M218998</link>
    <description>&lt;P&gt;The main thing that is not in this post is the CSF file that I had to figure out. We are not signing in production, just investigating. It's been a while I looked into this.&lt;BR /&gt;&lt;BR /&gt;$ cat &amp;gt; ahab-imx-boot.csf&amp;lt;&amp;lt;EOF&lt;BR /&gt;[Header]&lt;BR /&gt;Target = AHAB&lt;BR /&gt;Version = 1.0&lt;BR /&gt;&lt;BR /&gt;[Install SRK]&lt;BR /&gt;File = "./SRK_1_table.bin"&lt;BR /&gt;Source = "pkcs11:token=CST-HSM-DEMO;object=SRK1_sha384_4096_65537_usr;type=cert;pin-value=12345678"&lt;BR /&gt;Source index = 0&lt;BR /&gt;Source set = OEM&lt;BR /&gt;Revocations = 0x0&lt;BR /&gt;&lt;BR /&gt;[Authenticate Data]&lt;BR /&gt;File = "./flash.bin"&lt;BR /&gt;Offsets = 0x400 0x590&lt;BR /&gt;&lt;BR /&gt;EOF&lt;BR /&gt;&lt;BR /&gt;flash.bin is from a previous yocto build. "Authentication Data", the offsets come from the imx-mkimage tool output. The guide does not provide AHAB + HSM examples.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 22 Jan 2024 09:12:25 GMT</pubDate>
    <dc:creator>eduardo3</dc:creator>
    <dc:date>2024-01-22T09:12:25Z</dc:date>
    <item>
      <title>AN12812 - How to use CST with HSM</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/AN12812-How-to-use-CST-with-HSM/m-p/1703115#M210610</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I am trying to follow AN12812 to use CST 3.3.2 with softhsm2. Everything completes successfully with the exception of calling CST to do the actual signing, so I am a bit lost at the moment.&lt;/P&gt;&lt;P&gt;I have rebuilt CST and followed the steps in the application note. There is the content of the HSM, imx-boot.csf and the CST output.&lt;/P&gt;&lt;P&gt;I appreciate if additional debug info is needed (please let me know how to get it).&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;$ pkcs11-tool --module $PKCS11_MODULE -l --pin $USR_PIN --list-objects
Using slot 0 with a present token (0x10)
Certificate Object; type = X.509 cert
label: IMG1_1_sha256_2048_usr
subject: DN: CN=IMG1_1_sha256_2048_usr
ID: 1003
Private Key Object; RSA
label: CA1_sha256_2048_ca
ID: 1000
Usage: decrypt, sign, unwrap
Access: sensitive, always sensitive, never extractable, local
Public Key Object; RSA 2048 bits
label: CSF1_1_sha256_2048_usr
ID: 1002
Usage: encrypt, verify, wrap
Access: local
Public Key Object; RSA 2048 bits
label: CA1_sha256_2048_ca
ID: 1000
Usage: encrypt, verify, wrap
Access: local
Public Key Object; RSA 2048 bits
label: IMG1_1_sha256_2048_usr
ID: 1003
Usage: encrypt, verify, wrap
Access: local
Certificate Object; type = X.509 cert
label: SRK1_sha256_2048_ca
subject: DN: CN=SRK1_sha256_2048_ca
ID: 1001
Private Key Object; RSA
label: SRK1_sha256_2048_ca
ID: 1001
Usage: decrypt, sign, unwrap
Access: sensitive, always sensitive, never extractable, local
Private Key Object; RSA
label: CSF1_1_sha256_2048_usr
ID: 1002
Usage: decrypt, sign, unwrap
Access: sensitive, always sensitive, never extractable, local
Certificate Object; type = X.509 cert
label: CSF1_1_sha256_2048_usr
subject: DN: CN=CSF1_1_sha256_2048_usr
ID: 1002
Public Key Object; RSA 2048 bits
label: SRK1_sha256_2048_ca
ID: 1001
Usage: encrypt, verify, wrap
Access: local
Private Key Object; RSA
label: IMG1_1_sha256_2048_usr
ID: 1003
Usage: decrypt, sign, unwrap
Access: sensitive, always sensitive, never extractable, local&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;$ cat imx-boot.csf 
[Header]
        Version = 4.3
        Hash Algorithm = sha256
        Engine = CAAM
        Engine Configuration = 0
        Certificate Format = X509
        Signature Format = CMS

[Install SRK]
        File = "./SRK_1_table.bin"
        Source index = 0

[Install CSFK]
        File = "pkcs11:token=CST-HSM-DEMO;object=CSF1_1_sha256_2048_usr;type=cert;pin-value=12345678"

[Authenticate CSF]

[Unlock]
        Engine = CAAM
        Features = MID

[Unlock]
        Engine = CAAM
        Features = MFG

[Install Key]
        Verification index = 0
        Target index = 2
        File = "pkcs11:token=CST-HSM-DEMO;object=IMG1_1_sha256_2048_usr;type=cert;pin-value=12345678"

[Authenticate Data]
        Verification index = 2
        Blocks = 0x7e0fc0 0x0 0x2bc00 "flash.bin"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;$ cst -i imx-boot.csf -o imx-boot.csf.bin
Public key certificate is invalid in file pkcs11:token=CST-HSM-DEMO;object=CSF1_1_sha256_2048_usr;type=cert;pin-value=12345678&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Environment variables are defined like in the AN. I am running an up to date Ubuntu 20.04.&lt;/P&gt;&lt;P&gt;PKCS11_MODULE=/usr/lib/x86_64-linux-gnu/p11-kit-proxy.so&amp;nbsp;&lt;/P&gt;&lt;P&gt;SO_PIN=7635005489180126&amp;nbsp;&lt;/P&gt;&lt;P&gt;USR_PIN=12345678&lt;/P&gt;&lt;P&gt;SRK1_KEY=SRK1_sha256_2048_ca&lt;/P&gt;&lt;P&gt;CSF1_KEY=CSF1_1_sha256_2048_usr&lt;/P&gt;&lt;P&gt;IMG1_KEY=IMG1_1_sha256_2048_usr&lt;/P&gt;&lt;P&gt;Before running the openssl commands, I am using&amp;nbsp;&lt;/P&gt;&lt;P&gt;openssl engine dynamic -pre SO_PATH:/usr/lib/x86_64-linux-gnu/engines-1.1/pkcs11.so -pre ID:pkcs11 -pre LIST_ADD:1 -pre LOAD -pre MODULE_PATH:$PKCS11_MODULE&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help is appreciated.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Another thing is AN12812 only mentions HABv4, but I am using i.MX8X, which is AHAB.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Aug 2023 15:55:18 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/AN12812-How-to-use-CST-with-HSM/m-p/1703115#M210610</guid>
      <dc:creator>eduardo3</dc:creator>
      <dc:date>2023-08-10T15:55:18Z</dc:date>
    </item>
    <item>
      <title>Re: AN12812 - How to use CST with HSM</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/AN12812-How-to-use-CST-with-HSM/m-p/1703118#M210612</link>
      <description>&lt;P&gt;let me look into this.&lt;/P&gt;</description>
      <pubDate>Thu, 10 Aug 2023 16:00:39 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/AN12812-How-to-use-CST-with-HSM/m-p/1703118#M210612</guid>
      <dc:creator>Irene</dc:creator>
      <dc:date>2023-08-10T16:00:39Z</dc:date>
    </item>
    <item>
      <title>Re: AN12812 - How to use CST with HSM</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/AN12812-How-to-use-CST-with-HSM/m-p/1703699#M210666</link>
      <description>&lt;P style="color: #0e101a; background: transparent; margin-top: 0pt; margin-bottom: 0pt;"&gt;&lt;SPAN data-preserver-spaces="true"&gt;According to Code-Signing Tool User’s Guide, Rev. 3.3.2, you can use the PKCS backend via the command line without recompiling the CST.&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="color: #0e101a; background: transparent; margin-top: 0pt; margin-bottom: 0pt;"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="color: #0e101a; background: transparent; margin-top: 0pt; margin-bottom: 0pt;"&gt;&lt;SPAN data-preserver-spaces="true"&gt;In the Release Notes for Code-Signing Rev. 3.3.2, NXP has added backend support to support the pkcs11 interface. You can select the backend support by using the&lt;/SPAN&gt;&lt;STRONG style="color: #0e101a; background: transparent; margin-top: 0pt; margin-bottom: 0pt;"&gt;&lt;SPAN data-preserver-spaces="true"&gt;&amp;nbsp;‘-b pkcs11’&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN data-preserver-spaces="true"&gt;&amp;nbsp;parameter on the command line when invoking CST. CST will use the standard backend by default.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="color: #0e101a; background: transparent; margin-top: 0pt; margin-bottom: 0pt;"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="color: #0e101a; background: transparent; margin-top: 0pt; margin-bottom: 0pt;"&gt;&lt;SPAN data-preserver-spaces="true"&gt;Please take a look at Code-Signing Rev. 3.3.2 for AHAB.&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="color: #0e101a; background: transparent; margin-top: 0pt; margin-bottom: 0pt;"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="color: #0e101a; background: transparent; margin-top: 0pt; margin-bottom: 0pt;"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="color: #0e101a; background: transparent; margin-top: 0pt; margin-bottom: 0pt;"&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 11 Aug 2023 18:22:08 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/AN12812-How-to-use-CST-with-HSM/m-p/1703699#M210666</guid>
      <dc:creator>Irene</dc:creator>
      <dc:date>2023-08-11T18:22:08Z</dc:date>
    </item>
    <item>
      <title>Re: AN12812 - How to use CST with HSM</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/AN12812-How-to-use-CST-with-HSM/m-p/1704182#M210716</link>
      <description>&lt;P&gt;Adding "-b pkcs11" results in "CSF Processed successfully and signed data available in imx-boot.csf.bin" using the same CSF file I posted here. Thanks for that.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could you expand a bit on the "Code-Signing Rev. 3.3.2 for AHAB" part? Is it a document/section of a document/etc? It is not obvious what you are referring there.&lt;/P&gt;&lt;P&gt;Also, could you point the information (link, doc, etc) where that info is located?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 14 Aug 2023 08:21:25 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/AN12812-How-to-use-CST-with-HSM/m-p/1704182#M210716</guid>
      <dc:creator>eduardo3</dc:creator>
      <dc:date>2023-08-14T08:21:25Z</dc:date>
    </item>
    <item>
      <title>Re: AN12812 - How to use CST with HSM</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/AN12812-How-to-use-CST-with-HSM/m-p/1705098#M210832</link>
      <description>&lt;P&gt;Hello Eduardo,&lt;BR /&gt;The latest Code Signing Toolsi is version 3.3.2, which you can find on the nxp.com website. In that installation folder, you should see the Code-Signing Tool User’s Guide, Rev. 3.3.2, which has an example of using AHAB. We need to work on updating the Application Note.&lt;/P&gt;</description>
      <pubDate>Tue, 15 Aug 2023 16:00:51 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/AN12812-How-to-use-CST-with-HSM/m-p/1705098#M210832</guid>
      <dc:creator>Irene</dc:creator>
      <dc:date>2023-08-15T16:00:51Z</dc:date>
    </item>
    <item>
      <title>Re: AN12812 - How to use CST with HSM</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/AN12812-How-to-use-CST-with-HSM/m-p/1705540#M210878</link>
      <description>&lt;P&gt;I accepted the solution but &lt;STRONG&gt;NXP must update AN12812&lt;/STRONG&gt; or/and&amp;nbsp;&lt;STRONG&gt;add HSM examples to the main CST user guide&lt;/STRONG&gt;.&lt;/P&gt;</description>
      <pubDate>Wed, 16 Aug 2023 07:54:35 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/AN12812-How-to-use-CST-with-HSM/m-p/1705540#M210878</guid>
      <dc:creator>eduardo3</dc:creator>
      <dc:date>2023-08-16T07:54:35Z</dc:date>
    </item>
    <item>
      <title>Re: AN12812 - How to use CST with HSM</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/AN12812-How-to-use-CST-with-HSM/m-p/1792448#M218974</link>
      <description>&lt;P&gt;Hi,&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/19"&gt;@Irene&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/159240"&gt;@eduardo3&lt;/a&gt;&lt;BR /&gt;&lt;BR /&gt;I have similar requirement &amp;amp; want to sign the i.MX6/8 images with CST tool with third party HSM which is not in our organization network.&amp;nbsp;&lt;/P&gt;&lt;P&gt;The questions here is instead of SoftHSM, can we use external third party HSM to sign the images with CST tool without changing the default CST backend? I know we need HSM vendor PKCS#11 Module &amp;amp; configure at client side where we execute the CST tool.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/159240"&gt;@eduardo3&lt;/a&gt;&amp;nbsp;Are you able to sign the images with SoftHSM by following the steps mentioned in the above document i.e. AN12812?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Appreciate you help &amp;amp; support. Thanks.&lt;/P&gt;</description>
      <pubDate>Sun, 21 Jan 2024 11:41:12 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/AN12812-How-to-use-CST-with-HSM/m-p/1792448#M218974</guid>
      <dc:creator>jbhaijy</dc:creator>
      <dc:date>2024-01-21T11:41:12Z</dc:date>
    </item>
    <item>
      <title>Re: AN12812 - How to use CST with HSM</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/AN12812-How-to-use-CST-with-HSM/m-p/1792824#M218998</link>
      <description>&lt;P&gt;The main thing that is not in this post is the CSF file that I had to figure out. We are not signing in production, just investigating. It's been a while I looked into this.&lt;BR /&gt;&lt;BR /&gt;$ cat &amp;gt; ahab-imx-boot.csf&amp;lt;&amp;lt;EOF&lt;BR /&gt;[Header]&lt;BR /&gt;Target = AHAB&lt;BR /&gt;Version = 1.0&lt;BR /&gt;&lt;BR /&gt;[Install SRK]&lt;BR /&gt;File = "./SRK_1_table.bin"&lt;BR /&gt;Source = "pkcs11:token=CST-HSM-DEMO;object=SRK1_sha384_4096_65537_usr;type=cert;pin-value=12345678"&lt;BR /&gt;Source index = 0&lt;BR /&gt;Source set = OEM&lt;BR /&gt;Revocations = 0x0&lt;BR /&gt;&lt;BR /&gt;[Authenticate Data]&lt;BR /&gt;File = "./flash.bin"&lt;BR /&gt;Offsets = 0x400 0x590&lt;BR /&gt;&lt;BR /&gt;EOF&lt;BR /&gt;&lt;BR /&gt;flash.bin is from a previous yocto build. "Authentication Data", the offsets come from the imx-mkimage tool output. The guide does not provide AHAB + HSM examples.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 22 Jan 2024 09:12:25 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/AN12812-How-to-use-CST-with-HSM/m-p/1792824#M218998</guid>
      <dc:creator>eduardo3</dc:creator>
      <dc:date>2024-01-22T09:12:25Z</dc:date>
    </item>
    <item>
      <title>Re: AN12812 - How to use CST with HSM</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/AN12812-How-to-use-CST-with-HSM/m-p/1814526#M220356</link>
      <description>&lt;P&gt;Hello Irene,&lt;/P&gt;&lt;P&gt;I also would like to use the cst tool with PKCS11 backend without recompiling cst-tool.&lt;/P&gt;&lt;P&gt;Unfortunately I dont find the latest &lt;SPAN&gt;Code-Signing Tool User’s Guide, Rev. 3.3.2&lt;/SPAN&gt; and the cst-tool on the website nxp.com&lt;/P&gt;&lt;P&gt;Could you please give us the complete URLs to download the guide and the cst-tool with version 3.3.2?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;&lt;P&gt;David&lt;/P&gt;</description>
      <pubDate>Fri, 23 Feb 2024 09:34:51 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/AN12812-How-to-use-CST-with-HSM/m-p/1814526#M220356</guid>
      <dc:creator>kauschked</dc:creator>
      <dc:date>2024-02-23T09:34:51Z</dc:date>
    </item>
    <item>
      <title>Re: AN12812 - How to use CST with HSM</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/AN12812-How-to-use-CST-with-HSM/m-p/1820804#M220747</link>
      <description>&lt;P&gt;Any information to the questions above from you&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/19"&gt;@Irene&lt;/a&gt; ? Would be very helpful.&lt;/P&gt;</description>
      <pubDate>Mon, 04 Mar 2024 18:52:02 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/AN12812-How-to-use-CST-with-HSM/m-p/1820804#M220747</guid>
      <dc:creator>kauschked</dc:creator>
      <dc:date>2024-03-04T18:52:02Z</dc:date>
    </item>
    <item>
      <title>Re: AN12812 - How to use CST with HSM</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/AN12812-How-to-use-CST-with-HSM/m-p/1821099#M220764</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/125394"&gt;@kauschked&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;I believe CST-3.3.2 onwards the NXP has added pkcs11 supports in the CST tool with option &lt;STRONG&gt;-b pkcs11.&amp;nbsp;&lt;/STRONG&gt;Its default feature &amp;amp; hence no need to compile the CST again. You can follow the steps mentioned in AN12812 to setup the SoftHSM to test the CST pkcs11 feature.&amp;nbsp;&lt;/LI&gt;&lt;LI&gt;The latest CST release version which I see is CST-3.4.0 &amp;amp; its document explain how to execute the CST with &lt;STRONG&gt;-b pkcs11&lt;/STRONG&gt; option.&lt;/LI&gt;&lt;LI&gt;You will find &amp;amp; download the latest CST tool from&amp;nbsp;&lt;A href="https://www.nxp.com/search?keyword=IMX_CST_TOOL&amp;amp;start=0&amp;amp;category=software" target="_blank"&gt;https://www.nxp.com/search?keyword=IMX_CST_TOOL&amp;amp;start=0&amp;amp;category=software&lt;/A&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 05 Mar 2024 04:54:18 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/AN12812-How-to-use-CST-with-HSM/m-p/1821099#M220764</guid>
      <dc:creator>jbhaijy</dc:creator>
      <dc:date>2024-03-05T04:54:18Z</dc:date>
    </item>
    <item>
      <title>Re: AN12812 - How to use CST with HSM</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/AN12812-How-to-use-CST-with-HSM/m-p/1821165#M220767</link>
      <description>&lt;P&gt;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/148045"&gt;@jbhaijy&lt;/a&gt;Thank you very much for your help. /closed&lt;/P&gt;</description>
      <pubDate>Tue, 05 Mar 2024 06:34:33 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/AN12812-How-to-use-CST-with-HSM/m-p/1821165#M220767</guid>
      <dc:creator>kauschked</dc:creator>
      <dc:date>2024-03-05T06:34:33Z</dc:date>
    </item>
  </channel>
</rss>

