Questions tagged [strong-named-key]

A Strong Named Key (also called SN Key or Strong Name) is used in the Microsoft .NET framework to uniquely identify a component.

A strong name consists of the assembly's identity—its simple text name, version number, and culture information (if provided)—plus a public key and a digital signature. It is generated from an assembly file (the file that contains the assembly manifest, which in turn contains the names and hashes of all the files that make up the assembly), using the corresponding private key.

35 questions
36
votes
2 answers

Strong Name sn.exe: Failed to install key pair -- Object already exists

I have 2 different versions of the same project on my machine. One from the code trunk, and the other from a code branch. These projects use a .pfx key to enable strong naming. When I first tried to compile the trunk version of the project I get the…
ChrisG
  • 1,316
  • 1
  • 11
  • 14
13
votes
1 answer

Enumerating container names of the strong name CSP

I'm trying to find some information about how to (if at all possible) enumerate all container names in the Strong Name CSP (Cryptographic Service Provider). Essentially, when you type sn.exe -i key.snk MyContainerName, the public and private key…
Igal Tabachnik
  • 31,174
  • 15
  • 92
  • 157
7
votes
2 answers

Creating new key file to strongly name an assembly does not work in visual studio 2022

I'm using Visual Studio 2022, v17.0.4. I want to create new key for my assembly to strongly name it. According to documentation: "In the Choose a strong name key file box, choose Browse, and then navigate to the key file. To create a new key file,…
7
votes
4 answers

Simplest way to prevent someone from loading my managed assembly?

.Net security noob here... What is the simplest way to prevent someone else from loading my assembly? Background: Although I am really looking for just 'good enough' protection (with enough time/money/smarts someone can successfully crack, hack and…
JohnZaj
  • 3,080
  • 5
  • 37
  • 51
5
votes
1 answer

Access a strong name key (pfk) password in an AfterBuild event

If strong name signing an assembly with a password protected pfk is it possible to get access to the password used for the key in an AfterBuild node?
Simon
  • 33,714
  • 21
  • 133
  • 202
4
votes
1 answer

Mono xbuild error CS1548 - key file has incorrect format

So I'm trying to get a VS2010 C# project to go cross-platform. First goal is build it in Mono 2.10.5 for Windows. I have not touched any code yet - I'm starting with xbuild's recent ability to build sln files. (Incidentally I use Jenkins to…
Mykro
  • 276
  • 3
  • 11
4
votes
2 answers

StrongName a .NET assembly without access to original keyfile

I've made some changes to the code in an existing .NET assembly dll. I do not have the keyfile used to sign the code. How can I force the .NET executable to load it, without registering it for skipping verification (not portable), without removing…
Kurt Nauck
  • 339
  • 4
  • 15
3
votes
2 answers

strong name key corrupt or unreadable

On an infrequent random interval, some projects in a solution won't build anymore. Probably because of the strong named key file beging corrupt or lost.. resulting in the following errors when building the project: Error 1 Metadata file …
Caspar Kleijne
  • 21,552
  • 13
  • 72
  • 102
2
votes
0 answers

Signing assemblies with strong name and certificate

I understand that for strongly named C++ dll's I need to: create a Strong-Name Key File. Assign the Strong Name to the project, by add the key properties, (this way required to Set Common Language RunTime Support), or to specify the key file we…
user3114639
  • 1,895
  • 16
  • 42
1
vote
0 answers

Assigning Strong Name to Third Party DLL

I am trying to profile an IIS web Service Hosted on a different Machine through VSTS Command Line Tools. During this Process My(CommercialService.dll) file becomes Unsigned. So I resign my above Dll with same certificate and same public key token…
1
vote
0 answers

FileLoadException and strong assembly signing

I have an assembly which is referencing couple of other assemblies. Everything was working fine and then I went ahead and strongly signed all of the assemblies. The assembly contains entity designer and generated entities and context objects. Now…
1
vote
0 answers

error MSB3325: Cannot import the following key file, restart issue

I installed the key pair into the key container. I am then able to build. If I restart the computer, then I get the error again. (ResolveKeySource target) -> C:\Program Files (x86)\Microsoft Visual…
Sarah Weinberger
  • 15,041
  • 25
  • 83
  • 130
1
vote
2 answers

Create RSACryptoServiceProvider from public key ONLY

I am using the key-pair to sign my XML (using SignedXml) and I embed the public key in my app as embedded resources. Here how I create the key pair sn -k Warehouse.snk sn -p Warehouse.snk WarehousePublic.snk When I tried to read the…
Sam
  • 1,826
  • 26
  • 58
1
vote
1 answer

Adding a strong name key (.pfx) file to a project programmatically

I am able to create a self signed certificate and generate a .pfx file from code using makecert and pvk2pfx. I can edit the project file programmatically (using regex, although an xmlreader implementation might also work and perhaps be safer) to…
NullError
  • 71
  • 2
  • 11
1
vote
1 answer

Is it safe to change strong name key for new version of signed and published library?

While developing new libraries for product I generated keys (via Visual Studio) and signed libraries each with it own key with passwords. I've never encountered signing before and did this in hurry. We have now decided to use a common key for all…
CodingFeles
  • 374
  • 5
  • 18
1
2 3