-
-
Notifications
You must be signed in to change notification settings - Fork 108
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Strong name signing #50
Comments
Sure, I'll look into it. I'll have to see if there are any implications or compatibility-breaking changes for other users: I know some libraries publish separate NuGet packages for signed / non-signed versions, for instance. |
It shouldn't be a breaking change unless you roll a signed package using a previous version and someone consumes one of its types using the fully qualified type name. |
Looks like the issue quite a bit more complex than I'd anticipated:
|
Please don't do this. Strong naming is the bane of my existence. I'd rather you just recommend Strong Namer for the people that really want it. |
+1 to using StrongNamer, I use this for WPF/ClickOnce deployments and it does the job great |
Any updates on this? |
The current status is that I've had 2 requests for strong naming (including yours), 1 request not to strong name, and a workaround proposed. If you have experience with strong naming NuGet assemblies (which addresses the 4 points in my post above), and can contribute towards the effort, then I don't see the issue with releasing a second strong-named assembly... |
The simplest solution really is to use StrongNamer, it resolves the issue automatically with a build hook. I know of very few NuGet libraries which are signed, and doing so has the potential to introduce its own issues. |
StrongNaming is very easy, just follow these steps: 1] create a key 2] edit csproj file, add these 2 lines in the element <AssemblyOriginatorKeyFile>RestEase.snk</AssemblyOriginatorKeyFile>
<SignAssembly>true</SignAssembly> 3] In case you use And copy the public key (only the numbers) into the [assembly: InternalsVisibleTo("RestEase.Tests, PublicKey=002400.....97")] If you want to see it working, take a look at https://github.com/StefH/System.Linq.Dynamic.Core/ |
@Nick-Lucas It seems that StrongNamer is not supported in |
FWIW, the recommendation in non-Windows platforms was to "public sign" the assembly by adding <AssemblyOriginatorKeyFile>RestEase.snk</AssemblyOriginatorKeyFile>
<SignAssembly>true</SignAssembly>
<PublicSign Condition=" '$(OS)' != 'Windows_NT' ">true</PublicSign> From the C# compiler docs:
More details in the CoreFX repo. Also, this thread. Following that thread, however, TIL that signing is now supported cross-platform. |
Please reconsider strong-naming this assembly. This issue has been discussed over and over again but recently Microsoft actually made a official statement recommending that all OSS nuget packages should be strong named. https://docs.microsoft.com/en-us/dotnet/standard/library-guidance/strong-naming As an alternative |
In fairness, that article does say
And it also says:
Which I interpret as a weak recommendation to strong name, and a strong recommendation not to have both a strong-named and a non-strong-named version of the library. The 4 points in my original question are still awaiting answers. If you have any input on those please provide it! |
Sorry I can only provide the input about the 2th and 4hth question.
This is actually not true anymore, it's easy to sign the assemblies now using the new project system by using the
The official recommendation is to commit the key into the source system. |
This is OSS, the source code is right here, waiting to be forked. If you need strong naming, build it and strong-name it yourself - don't push your requirements and everything it entails onto 1) other users of the package, and 2) the maintainers of the package. I strongly oppose this proposal. |
It should be noted that Strong Namer does not support net45, which RestEase does support, so recommending Strong Namer is an imperfect solution - along with all the other problems that Strong Namer has with new SDK projects. I would propose looking at other open source projects, and how they strong name. Strong naming is an unfortunate requirement for many - even though some don't need it. |
Hello @canton7, sorry to bother you about this issue. but do you have any update on this? |
Same as last time:
|
I think you can just sign it. And if people or projects are having issues, you can always release a
I never had issues creating a signed NuGet.
I do not delay the signing in my projects. I just sign it. According to ChatGPT-4:
I do commit it, but if you are really are concerned that other people/projects can use your key and use it for other projects, then you should keep it outside of source-control I hope I did clarify some questions. |
That's where Chat-GPT is wrong. Strong signing shouldn't be used for security (it's too weak, and there lacks needed verification checks), code signing should be - which doesn't modify the assembly identity. The point of strong signing is to increase the uniqueness of the assembly identity - the most common reason, is if installing the assembly into the GAC. Really, strong signing is an artifact of .NET Framework - and security researchers that don't look deeper than the name. |
We are using this great library in an environment where every package is signed. Currently we are signing this library during our build process. However it is currently fine but it would be great if you can sign the library. What do you think about this?
The text was updated successfully, but these errors were encountered: