{"id":249984,"date":"2024-07-29T08:00:14","date_gmt":"2024-07-29T15:00:14","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/visualstudio\/?p=249984"},"modified":"2024-07-26T15:27:56","modified_gmt":"2024-07-26T22:27:56","slug":"sign-vsix-packages-with-sign-cli","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/visualstudio\/sign-vsix-packages-with-sign-cli\/","title":{"rendered":"Sign VSIX packages with Sign CLI"},"content":{"rendered":"<p>You can now leverage <a href=\"https:\/\/github.com\/dotnet\/sign\">Sign CLI<\/a> for a more secure, modern way to sign your Visual Studio extensions. Signing your VSIX packages improves security, prevents tampering, and builds trust with your users. This integration makes it easier and more convenient to sign your packages than ever before!<\/p>\n<p><img decoding=\"async\" class=\"alignnone wp-image-249987\" src=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2024\/07\/a-screenshot-of-a-computer-description-automatica.png\" alt=\"Screenshot of the VSIX Installer with the digital signature highlighted.\" width=\"436\" height=\"332\" srcset=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2024\/07\/a-screenshot-of-a-computer-description-automatica.png 436w, https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2024\/07\/a-screenshot-of-a-computer-description-automatica-300x228.png 300w\" sizes=\"(max-width: 436px) 100vw, 436px\" \/><\/p>\n<p>Sign CLI replaces the older VSIXSignTool with a modern, general purpose sign tool that\u2019s actively maintained and kept up to date with the latest security standards. It supports cloud and local signing from a variety of sources and can also fit seamlessly into your CI pipeline for easy integration. Continue reading to learn how to enhance your extension publishing workflow by using Sign CLI!<\/p>\n<h2>Obtain a code signing certificate<\/h2>\n<p>To sign your VSIX, you\u2019ll need a valid EV or standard certificate from a public certificate authority that utilizes SHA 256, SHA 384, or SHA 512 digest algorithms. Windows supports certificates from many popular certificate authorities, such as <a href=\"https:\/\/www.certum.eu\/certum\/cert,offer_en_open_source_cs.xml\">Certum<\/a>, <a href=\"https:\/\/www.comodo.com\/e-commerce\/code-signing\/code-signing-certificate.php\">Comodo<\/a>, <a href=\"https:\/\/www.digicert.com\/code-signing\/\">DigiCert<\/a>, <a href=\"https:\/\/www.globalsign.com\/en\/code-signing-certificate\/\">GlobalSign<\/a>, <a href=\"https:\/\/www.ssl.com\/certificates\/code-signing\/\">SSL.com<\/a>, and more.<\/p>\n<p>For a full list of trusted partners, please see <a href=\"https:\/\/aka.ms\/TrustCertPartners\">https:\/\/aka.ms\/TrustCertPartners<\/a>.<\/p>\n<h2>Get ready to sign your extensions<\/h2>\n<p>To start using Sign CLI to sign your extension packages, you\u2019ll first need to install it. It\u2019s available as a dotnet tool on the nuget.org Gallery. To install, open Visual Studio\u2019s integrated terminal using View &gt; Terminal (or use the Ctrl+` shortcut), then use the commands below. Note that if you\u2019re working outside of Visual Studio, you can access the Developer PowerShell by selecting Start in Windows then typing in \u201cdeveloper PowerShell\u201d.<\/p>\n<h3>Install Sign CLI<\/h3>\n<p>The Sign tool is still a prerelease version, so you\u2019ll need to include the `&#8211;prerelease` flag when you install to get the latest:<\/p>\n<p><code>dotnet tool install sign --prerelease --global<\/code><\/p>\n<p>To install a specific version, visit the versions tab on the <a href=\"https:\/\/www.nuget.org\/packages\/sign&quot; \\l &quot;versions-body-tab\">Sign CLI page on nuget.org<\/a> to find the version you\u2019re interested in and use the following syntax:<\/p>\n<p><code>dotnet tool install sign --global --version &lt;version&gt;<\/code><\/p>\n<h4>Offline installation<\/h4>\n<p>In the event you\u2019re working in an isolated environment, you can download the Sign CLI NuGet package you want and install it using:<\/p>\n<p><code>dotnet tool install --global --version &lt;version&gt; --add-source &lt;path to folder&gt; sign<\/code><\/p>\n<h2>Sign your VSIX using Sign CLI<\/h2>\n<p>Sign CLI supports cloud signing with Azure Key Vault or local signing using certificates and private keys stored in:<\/p>\n<ul>\n<li>PFX\/P7B\/CER files<\/li>\n<li>The Windows Certificate Manager<\/li>\n<li>A USB device with access to a <a href=\"https:\/\/learn.microsoft.com\/en-us\/windows\/win32\/seccrypto\/cryptographic-service-providers.\">Cryptographic Service Provider<\/a> (CSP)<\/li>\n<\/ul>\n<p>Once installed, you can use Sign CLI from a Visual Studio\u2019s integrated terminal (View &gt; Terminal).<\/p>\n<p>For example, to sign a VSIX using a PFX file with a certificate and a private key, use a command like the following:<\/p>\n<p><code>sign code certificate-store -cfp &lt;SHA-256 fingerprint&gt; -cf \"D:\\Certs\\my.pfx\" -d \"VSIX Signature\" -u \"http:\/\/timestamp.acs.microsoft.com\/\" \"C:\\Users\\Contoso\\Downloads\\FingerSnapper2022.vsix\"<\/code><\/p>\n<p>Or to sign a VSIX using the Microsoft Certificate Manager:<\/p>\n<p><code>sign code certificate-store -cfp &lt;SHA-256 fingerprint&gt; -d \"VSIX Signature\" -u \"<a href=\"http:\/\/timestamp.acs.microsoft.com\/\">http:\/\/timestamp.acs.microsoft.com\/<\/a>\" \"C:\\Users\\Contoso\\Downloads\\FingerSnapper2022.vsix\"<\/code><\/p>\n<p>For more detailed instructions, please visit our <a href=\"https:\/\/learn.microsoft.com\/visualstudio\/extensibility\/signing-vsix-packages\">Signing VSIX Packages<\/a> article where you can also find a <a href=\"https:\/\/learn.microsoft.com\/visualstudio\/extensibility\/dotnet-sign-cli-reference-vsix\">breakdown of all of the command-line options<\/a> for Sign.<\/p>\n<h2>Let us know what you think<\/h2>\n<p>As you use Sign CLI to sign your extensions, please use the <a href=\"https:\/\/github.com\/dotnet\/sign\/issues\">Issues tracker<\/a> on the <a href=\"https:\/\/github.com\/dotnet\/sign\">Sign CLI GitHub repo<\/a> to report any issues or bugs you experience. If you want to provide general feedback on extension signing or to suggest additional features, please create a <a href=\"https:\/\/developercommunity.visualstudio.com\/VisualStudio\">feedback ticket<\/a> at the Visual Studio Developer Community.<\/p>\n<p>We\u2019re excited to hear from you!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>You can now leverage Sign CLI for a more secure, modern way to sign your Visual Studio extensions. Signing your VSIX packages improves security, prevents tampering, and builds trust with your users. This integration makes it easier and more convenient to sign your packages than ever before! Sign CLI replaces the older VSIXSignTool with a [&hellip;]<\/p>\n","protected":false},"author":108688,"featured_media":249987,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1388,155],"tags":[294,12,6815],"class_list":["post-249984","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-extensibility","category-visual-studio","tag-extensions","tag-visual-studio","tag-visual-studio-2022"],"acf":[],"blog_post_summary":"<p>You can now leverage Sign CLI for a more secure, modern way to sign your Visual Studio extensions. Signing your VSIX packages improves security, prevents tampering, and builds trust with your users. This integration makes it easier and more convenient to sign your packages than ever before! Sign CLI replaces the older VSIXSignTool with a [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/posts\/249984","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/users\/108688"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/comments?post=249984"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/posts\/249984\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/media\/249987"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/media?parent=249984"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/categories?post=249984"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/tags?post=249984"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}