Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 115913
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T03:05:42+00:00 2026-05-11T03:05:42+00:00

The Windows SDK ships with a tool called signtool.exe that lets you sign a

  • 0

The Windows SDK ships with a tool called signtool.exe that lets you sign a file with a certificate. I need to do the same thing but in a background service so I’m on the lookout for a library (preferably managed code, but COM will do) to do the same thing. Any ideas?

Found the answer. Here’s how to use an X.509 certificate to sign a file in .NET:

CmsSigner signer = new CmsSigner(); signer.Certificate = new X509Certificate2(certificate);  SignedCms content = new SignedCms(new ContentInfo(File.ReadAllBytes(fileToSign))); content.ComputeSignature(signer, true); byte[] signedFile = content.Encode();  string signedFileName = fileToSign + '.signed'; File.WriteAllBytes(signedFileName, signedFile);  Console.WriteLine('Signed file: ' + signedFileName); 

Here, certificate is the path to the .pfx file containing the certificate and fileToSign is the file to sign.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T03:05:42+00:00Added an answer on May 11, 2026 at 3:05 am

    SignTool is using CAPICOM which is the COM wrapper for the Crypto API. You can use either one. If you’re going with CAPICOM, you can check the information here.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

in the windows SDK there is this file residing in the Lib-directory. Is it
Windows SDK features IsEqualGUID() function and operator==() for two GUIDs that return BOOL (equivalent
We have to install Windows SDK along with .NET Framework. Why do we need
In one of the samples that come w/ Windows SDK (the CreateProcessVerb sample), the
I've implemented a windows deskband (using the windows SDK sample) and need a way
I trying to use a .h file from Windows SDK in a .NET language
It is a WCF tool and why it is located within Windows SDK and
How do I create a self-signed certificate for code signing using the Windows SDK?
The Windows SDK for Server 2008 does not include Inspect.exe. Does anyone know where
I have dumped a Windows SDK .lib file (kernel32.lib) with DUMPBIN, the output show

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.