How to: Import and Apply Certificates in Device Projects
The Select Certificate dialog box is the central portal for signing device projects. It provides an entry to the Manage Certificates dialog box and the Certificate Import Wizard as described in the following steps.
Your computer might show different names or locations for some of the Visual Studio user interface elements in the following instructions. The Visual Studio edition that you have and the settings that you use determine these elements. For more information, see Visual Studio Settings.
How you access the Select Certificate dialog box depends on the type of project you want to sign.
To display the Select Certificate dialog box
In Solution Explorer, right-click <Projectname>, and then click Properties.
Continue by using one of the following procedures:
For Visual Basic and Visual C# projects: In the Project Designer, click Devices, select Authenticode Signature, and then click Select Certificate.
In Visual C++ projects, select Authenticode Signing, and then click the ellipsis button in the Certificate property row.
In Smart Device CAB projects, select Authenticode Signing, and then click Select from Store.
After you have displayed the Select Certificate dialog box as described in the previous steps, you can select the certificate you want.
To select a certificate for the project by using the Select Certificate dialog box
If the Select Certificate dialog box displays the certificate you want for the project, select the certificate, and then click OK.
The project is signed with that certificate when the project is built.
If the Select Certificate dialog box does not display the certificate you want for the project, you can import a certificate by using the Certificate Import Wizard.
The following steps show how to populate the Select Certificate dialog box by importing the test certificates provided by Visual Studio and applying them to a project. You can follow this same procedure if you want to apply a different certificate.
Visual Studio provides three user interface elements for the task of importing a certificate to apply to a project:
The Select Certificate dialog box, which specifies which certificates are to be applied to the current project.
The Manage Certificates dialog box, which lists the certificate files available on the development computer.
The Certificate Import Wizard, which guides you in selecting your certificate file and specifying where you want to store it.
To import a test certificate by using the Certificate Import Wizard
In the Select Certificate dialog box, click Manage Certificates.
The Manage Certificates dialog box displays a list of certificates stored on the development computer.
Click Import to open the Certificate Import Wizard.
Click Next to open the File to Import page of the wizard.
Click Browse to navigate to the TestCertificates folder in Visual Studio.
By default, this folder is at drive:\Program Files\Microsoft Visual Studio 9.0\SmartDevices\SDK\SDKTools.
Change the Files of Type selection to All Files (*.*), select TestCert_Privileged.pfx or TestCert_Unprivileged.pfx, and then click Open.
On the File to Import page of the wizard, click Next to open the Password page.
Leave the Passwod box blank. These test certificates do not have a password.
Click Next to open the Certificate Store page. Ensure that Personal is selected in the Certificate store box.
Click Next to display the completion page, and then click Finish.
The message Import was successful appears.
Click OK to dismiss the message.
The certificate now appears in the Manage Certificates list. Click Close to return to the Select Certificate dialog box.
Select the certificate you want, and then click OK.
The certificate is now listed on the property page you started from.