.NET Publisher Certificates

655 Views Asked by At

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:

  1. Wrote C# console application that uses StreamReader to read the file and output to the console. The application works as expected.
  2. 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.
  3. Next, I clicked the More Details button, navigated to the Details tab, selected the Public Key row, and clicked the Copy to File button.
  4. 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.
  5. Next I rebuilt the application.
  6. I opened the .NET Framework 2.0 Configuration tool.
  7. I navigated to My Computer > Runtime Security > Machine > Code Groups > All_Code
  8. Right clicked All_Code, and selected New to begin the Create Code Group wizard.
  9. Gave the new code group a name, then selected the Publisher condition type.
  10. Clicked the Import from Certificate File button, then selected the newly created .CER file.
  11. Next I selected the Nothing permission set.
  12. 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.

1

There are 1 best solutions below

5
Henk Holterman On BEST ANSWER

Can your application read the file in question w/o any certificate?

Adding Nothing to a set of existing permissions won't change much.