I'm using a book for studying for .NET certification, and I'm stumped on the issue of publisher certificates.
Background:
Windows Vista Home Basic SP2 Visual Studio 2008 .NET 3.5 SP1
Goal:
Write a simple C# console application that has its permission to read from a specific text file determined by the application's certificate.
Symptoms:
I am able to read from the file despite assigning the Nothing permission set to the code group that is conditioned by the application's certificate.
Steps taken:
- Wrote C# console application that uses StreamReader to read the file and output to the console. The application works as expected.
- On the application's properties, I used the Signing tab, set ON the checkbox for "Sign the ClickOnce manifest", clicked the Create Test Certificate button, and entered passwords.
- Next, I clicked the More Details button, navigated to the Details tab, selected the Public Key row, and clicked the Copy to File button.
- In the Certificate Export Wizard, I chose not to export the private key, chose the DER encoded binary X.509 format, and provided the path of the .CER file.
- Next I rebuilt the application.
- I opened the .NET Framework 2.0 Configuration tool.
- I navigated to My Computer > Runtime Security > Machine > Code Groups > All_Code
- Right clicked All_Code, and selected New to begin the Create Code Group wizard.
- Gave the new code group a name, then selected the Publisher condition type.
- Clicked the Import from Certificate File button, then selected the newly created .CER file.
- Next I selected the Nothing permission set.
- When running the application, which should now be a member of the new code group, it still works the same. I would expect that if it's a member of the Nothing permission set that it couldn't read the file.
Thanks for any insight you can provide. I'm probably missing one little detail. I wonder if this has anything to do with using Vista Home Basic.