{"id":3628,"date":"2023-08-14T13:49:20","date_gmt":"2023-08-14T17:49:20","guid":{"rendered":"https:\/\/www.tmurgent.com\/TmBlog\/?p=3628"},"modified":"2023-08-14T14:21:44","modified_gmt":"2023-08-14T18:21:44","slug":"signing-packages-using-tmeditx-and-digicert-keylocker","status":"publish","type":"post","link":"https:\/\/www.tmurgent.com\/TmBlog\/?p=3628","title":{"rendered":"Signing Packages using TMEditX  and DigiCert KeyLocker"},"content":{"rendered":"\n<p><strong>This article describes support for MSIX Package Signing by TMEditX when using the new DigiCert KeyLocker Code-Signing service.&nbsp; It will be included in version 3.4 of TMEditX.<\/strong><\/p>\n\n\n\n<p>Until recently, you had three choices when it came to the signing of your MSIX packages:<\/p>\n<ol>\n<li>Create your own free private certificate, suitable when packages are only distributed for consumption inside your own organization.&nbsp; This produces a password protected PSF file that you use.<\/li>\n<li>Purchase a code signing certificate from a public Certificate Authority.&nbsp; This prevents the need to install the certificate on end-user devices and allows for external use of the package (such as for customers or contractors).<\/li>\n<li>Use Device Guard V2 signing via Azure.&nbsp; Also free, mainly for use in your Azure tenant.&nbsp; There are known issues with multiple regions. Here, you never touch the actual certificate.<\/li>\n<\/ol>\n\n\n\n<p>Due to problems with large software providers that lost control of their public code signing certificate, the industry is moving to new standards for the storage of the certificates.&nbsp; DigiCert has an article explaining these new requirements <a href=\"https:\/\/knowledge.digicert.com\/generalinformation\/new-private-key-storage-requirement-for-standard-code-signing-certificates-november-2022.html\">New private key storage requirement for Code Signing certificates (digicert.com)<\/a> &nbsp;<\/p>\n<p>These changes do not affect (at least for now) how you would create\/protect\/use a private code signing certificate, but new certificates from public CAs need to meet the new standards, and Microsoft appears to be closing down Device Guard signing in favor of a new Azure Code Signing service that is currently in private preview mode (GA date is uncertain but I hear that Microsoft has already stopped accepting new Device Guard Certificate service setup requests).<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">It is unfortunate that these new standards will complicate our use of code signing certificates, but we&#8217;ll have to live with it.<\/p>\n\n\n\n<p>The new standards require that certificates be stored in a secure location; generically we can say this means an HSM device or service.<\/p>\n<p>DigiCert started issuing certificates on June 1 that meet the new standards. They offer two choices when buying or renewing your certificate.&nbsp; You can store on a FIPS 140-2 level 2 compliant HSM based storage (and they will sell you a compliant USB token for $150 or you can use your own), or you can use their KeyLocker cloud-based service (which also has an annual storage fee for the cert that isn&#8217;t so well documented at present).<\/p>\n<p>To use an HSM device, it needs to be present on the VM where signing is being performed.&nbsp; This isn&#8217;t necessarily convenient for automation or remote VMs.&nbsp; The use of the KeyLocker service may be automated.<\/p>\n<p>To use the KeyLocker service, see the DigiCert documentation for all the details (<a href=\"https:\/\/docs.digicert.com\/en\/digicert-keylocker.html\">DigiCert KeyLocker<\/a>), but here is what you&#8217;ll do to get set up.<\/p>\n<ol>\n<li>You request that your DigiCert account add the KeyLocker Service.&nbsp; This seems easiest done by purchasing a certificate to be stored there and then adding a note to the technician to add the service to your account.<\/li>\n<li>Add appropriate user accounts to the KeyLocker service.<\/li>\n<li>Get the DigiCert ONE API Key.<\/li>\n<li>Install some DigiCert provided tools on the signing VM.&nbsp;<\/li>\n<li>Add the path to smctl.exe to the system PATH variable.<\/li>\n<li>Authenticate with the service and create a client certificate for your device.<\/li>\n<li>Store the client authentication certificate in the windows certificate store.<\/li>\n<li>Create a keypair alias on the service that authorizes signing for that key from this device.<\/li>\n<li>Run &#8220;smctl.exe healthcheck&#8221; from a command line to prove that you are ready to go.<\/li>\n<\/ol>\n\n\n\n<p>To use KeyLocker in TMEditX, you will need to enter some information into the Options page. Normally the page would look something like this:<\/p>\n\n\n\n<p><img decoding=\"async\" src=\"https:\/\/www.tmurgent.com\/\/TmBlog\/wp-content\/uploads\/2023\/09\/TMEditX_Options_Signtool.png\"\/><\/p>\n\n\n\n<p>Change the Signing Method to DigiCert Keylocker, type in the keypair-alias and click the button to extract the subject field out of the associated certificate.&nbsp; This value will be placed in the Subject field below and used to update the Publisher field of the manifest.<br \/>Don&#8217;t forget to click the Apply button on the bottom of the page to save these settings!<\/p>\n\n\n\n<p><img decoding=\"async\" src=\"https:\/\/www.tmurgent.com\/\/TmBlog\/wp-content\/uploads\/2023\/09\/TMEditX-Options-Digicert.png\"\/><\/p>\n\n\n\n<p>With these settings in place, when you save the MSIX package TMEditX will:<\/p>\n<ul>\n<li>Update the Publisher field to match the subject field of the package.<\/li>\n<li>Optionally increase the package version number.<\/li>\n<li>Use smctl.exe from the DigiCert Tools to communicate with the service and then use signtool to sign the package using new extensions that Microsoft added.&nbsp; It will also timestamp the signing using the DigiCert timestamping service.<\/li>\n<\/ul>\n\n\n\n<p>You can see this in the output after signing:<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.tmurgent.com\/\/TmBlog\/wp-content\/uploads\/2023\/09\/smctl.png\"\/><\/p>\n\n\n\n<p>NOTE: The new Azure Code Signing service will also require a special setup when added to TMEditX as a third signing method.\u00a0 We are not only waiting for GA of that service, but there may be some additional support we are requesting to be added, so that you don&#8217;t have to type in the Subject field.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This article describes support for MSIX Package Signing by TMEditX when using the new DigiCert KeyLocker Code-Signing service.&nbsp; It will be included in version 3.4 of TMEditX. Until recently, you had three choices when it came to the signing of your MSIX packages: Create your own free private certificate, suitable when packages are only distributed&hellip; <a class=\"more-link\" href=\"https:\/\/www.tmurgent.com\/TmBlog\/?p=3628\">Continue reading <span class=\"screen-reader-text\">Signing Packages using TMEditX  and DigiCert KeyLocker<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_crdt_document":"","_exactmetrics_skip_tracking":false,"_exactmetrics_sitenote_active":false,"_exactmetrics_sitenote_note":"","_exactmetrics_sitenote_category":0,"footnotes":""},"categories":[53,57],"tags":[52],"class_list":["post-3628","post","type-post","status-publish","format-standard","hentry","category-msix","category-packaging","tag-msix","entry"],"_links":{"self":[{"href":"https:\/\/www.tmurgent.com\/TmBlog\/index.php?rest_route=\/wp\/v2\/posts\/3628","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.tmurgent.com\/TmBlog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.tmurgent.com\/TmBlog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.tmurgent.com\/TmBlog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.tmurgent.com\/TmBlog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3628"}],"version-history":[{"count":3,"href":"https:\/\/www.tmurgent.com\/TmBlog\/index.php?rest_route=\/wp\/v2\/posts\/3628\/revisions"}],"predecessor-version":[{"id":3635,"href":"https:\/\/www.tmurgent.com\/TmBlog\/index.php?rest_route=\/wp\/v2\/posts\/3628\/revisions\/3635"}],"wp:attachment":[{"href":"https:\/\/www.tmurgent.com\/TmBlog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3628"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.tmurgent.com\/TmBlog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3628"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.tmurgent.com\/TmBlog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3628"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}