You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This article explains how to create and export a certificate for app package signing using PowerShell tools. It's recommended that you use Visual Studio for [packaging UWP apps](packaging-uwp-apps.md) and [packaging desktop apps](../desktop/desktop-to-uwp-packaging-dot-net.md), but you can still package an app manually if you did not use Visual Studio to develop your app.
12
+
This article explains how to create and trust a certificate for app package signing using PowerShell tools (for CMD tools, see [here](/windows/win32/appxpkg/how-to-create-a-package-signing-certificate)). It's recommended that you use Visual Studio for [packaging UWP apps](packaging-uwp-apps.md) and [packaging desktop apps](../desktop/desktop-to-uwp-packaging-dot-net.md), but you can still package an app manually if you did not use Visual Studio to develop your app.
13
13
14
14
## Prerequisites
15
15
@@ -47,7 +47,7 @@ Use the **New-SelfSignedCertificate** PowerShell cmdlet to create a self signed
47
47
Based on the AppxManifest.xml file from the previous example, you should use the following syntax to create a certificate. In an elevated PowerShell prompt:
Note the following details about some of the parameters:
@@ -60,7 +60,7 @@ Note the following details about some of the parameters:
60
60
61
61
- Basic Constraints: This extension indicates whether or not the certificate is a Certificate Authority (CA). For a self-signing certificate, this parameter should include the extension string **"2.5.29.19={text}"**, which indicates that the certificate is an end entity (not a CA).
62
62
63
-
After running this command, the certificate will be added to the local certificate store, as specified in the "-CertStoreLocation" parameter. The result of the command will also produce the certificate's thumbprint.
63
+
After running this command, the certificate will be created and added to the User Personal certificate store. The result of the command will also produce the certificate's thumbprint.
64
64
65
65
You can view your certificate in a PowerShell window by using the following commands:
This will display all of the certificates in your local store.
72
+
This will display all of the certificates in the User Personal certificate store.
73
73
74
-
## Export a certificate
74
+
In order to install an app signed with this certificate, the certificate must be imported into the Local Machine Trusted People certificate store.
75
75
76
-
To export the certificate in the local store to a Personal Information Exchange (PFX) file, use the **Export-PfxCertificate** cmdlet.
76
+
## Export the certificate to a PFX file
77
77
78
-
When using **Export-PfxCertificate**, you must either create and use a password or use the "-ProtectTo" parameter to specify which users or groups can access the file without a password. Note that an error will be displayed if you don't use either the "-Password" or "-ProtectTo" parameter.
78
+
In order to import the newly created certificate into the Local Machine Trusted People certificate store, you need to first export it to a Personal Information Exchange (PFX) file using the **Export-PfxCertificate** cmdlet.
79
+
80
+
When using **Export-PfxCertificate**, you must either create and use a password or use the "-ProtectTo" parameter to specify which users or groups can access the file without a password. Note that an error will be displayed if you don't use either the "-Password" or "-ProtectTo" parameter. "-Password" is recommended for general usage while "-ProtectTo" is useful when your user account is backed by a domain controller.
Export-PfxCertificate -cert Cert:\CurrentUser\My\<Certificate Thumbprint> -FilePath <FilePath>.pfx -ProtectTo <Username or group name>
91
93
```
92
94
93
-
After you create and export your certificate, you're ready to sign your app package with **SignTool**. For the next step in the manual packaging process, see [Sign an app package using SignTool](sign-app-package-using-signtool.md).
95
+
## Import the certificate to the Local Machine Trusted People store
96
+
97
+
Now that you've exported the certificate to a PFX file, you can import it into the Local Machine Trusted People store using the **Import-PfxCertificate** cmdlet from an admin PowerShell session.
Now that the certificate is trusted, you're ready to sign your app package with **SignTool**. For the next step in the manual packaging process, see [Sign an app package using SignTool](sign-app-package-using-signtool.md).
0 commit comments