-1

Our Network has an application that blocks all applications unless they are whitelisted. Whitelisting an application takes a while due to the requests taking forever to get picked up, and each time an application gets updated it has to be whitelisted again.

A solution is to use digital signatures and have the signature whitelisted. Now my question is: How can I add a custom digital signature (without downloading third party software or DLL's) to the C# WinForm application (.NET Framework 4.7.2). using Visual Studio 2022 without costs.

It's supposed to show up in the EXE's Properties like this: enter image description here

It is only for internal use, not distribution so it doesn't have to be anything professional or official.

I tried looking online, but each time i end up with something highly convoluted far beyond what I need.

I tried using the Signing tab under the properties window of my project, but in all honestly I am clueless on what to do with it seeing i have trouble finding understandable documentation.

Thanks the the comments and some additional searching i found this link:

https://youtu.be/y00n9alXHGs?t=24 But it seems to require third party software or online connection, anyway around that?

A.bakker
  • 221
  • 1
  • 9
  • **Comments have been [moved to chat](https://chat.stackoverflow.com/rooms/252839/discussion-on-question-by-a-bakker-how-to-sign-a-winform-application-security-c); please do not continue the discussion here.** Before posting a comment below this one, please review the [purposes of comments](/help/privileges/comment). Comments that do not request clarification or suggest improvements usually belong as an [answer](/help/how-to-answer), on [meta], or in [chat]. Comments continuing discussion may be removed. – Samuel Liew Mar 29 '23 at 00:26

1 Answers1

1

You may create self signed certificate with certools (free).

Certificates can be created using makecert.exe + pvk2pfx.exe.

You can refer to the following links: Can I create a self-signed SSL certificate for Windows Azure using only makecert.exe?

After the certificate is created, update your project, i.e. insert the signtool command in the post-build event executed after compilation. Reference: How to: Specify build events (C#)

Create a bat file .exe containing signtool.

In Visual Studio Solution Explorer, edit post-build events in /build/events: just insert "postbuild.bat" (or the full command that exists in the batch) here

Jiale Xue - MSFT
  • 3,560
  • 1
  • 6
  • 21
  • Finnaly came around to actually have Compliance test the certificate, it was a failure. So i'm looking at other solutions because this doesn't seem to be it. – A.bakker Apr 04 '23 at 11:22