Key file

C

Carl Forsman

In a C# project why people need to use a Key file like the following:

===============================
* Execute the command:
sn.exe -k ManagedReaderLibrary.pfx

* In the Property Pages windows, click on 'Configuration Properties'
followed by 'Linker'. Under the 'Key File' option enter the
following:

ManagedReaderLibrary.pfx

* Click on the 'Signing' tab and if the 'Sign the assembly' option is
not checked, do so now.

* In the 'Choose a strong name key file:' combo box, select the
<New...> option. This will open a new dialog box where you will enter
a name for a new key file and ( optional ) key file password. Once
you have entered this information click OK.
===============================

I assume the ManagedReaderLibrary.pfx is a private key file? or a
certificate?

Is this C# specific procedure? to make the code more secure by signing
the code with a public key / private key / digital signature so no
other people can fake your own code / program / virus?

Is that all C# project must do the above procedure?

then strong name is C# specific and it is used to sign you code to
make it unquie and no one can release the code with your own private
key?
 
F

Family Tree Mike

Carl Forsman said:
In a C# project why people need to use a Key file like the following:

===============================
* Execute the command:
sn.exe -k ManagedReaderLibrary.pfx

* In the Property Pages windows, click on 'Configuration Properties'
followed by 'Linker'. Under the 'Key File' option enter the
following:

ManagedReaderLibrary.pfx

* Click on the 'Signing' tab and if the 'Sign the assembly' option is
not checked, do so now.

* In the 'Choose a strong name key file:' combo box, select the
<New...> option. This will open a new dialog box where you will enter
a name for a new key file and ( optional ) key file password. Once
you have entered this information click OK.
===============================

I assume the ManagedReaderLibrary.pfx is a private key file? or a
certificate?

Is this C# specific procedure? to make the code more secure by signing
the code with a public key / private key / digital signature so no
other people can fake your own code / program / virus?

Is that all C# project must do the above procedure?

then strong name is C# specific and it is used to sign you code to
make it unquie and no one can release the code with your own private
key?


Strong naming is a .Net thing, not a C# specific thing. That is the normal
procedure for us with all of our projects, be they C# or VB.
 
C

Carl Forsman

Strong naming is a .Net thing, not a C# specific thing. That is the normal
procedure for us with all of our projects, be they C# or VB.

what happen if i dont' specify any key file when complie? will program
still run? will it set a default generic key file automatically?
 
F

Family Tree Mike

Carl Forsman said:
what happen if i dont' specify any key file when complie? will program
still run? will it set a default generic key file automatically?


You do not need to create a strong name for your code to work. The default
is in fact not to create a strong named assembly.

If you plan to register with the global assembly cache, you need to have a
strong named assembly.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top