|
-
May 24th, 2007, 01:44 AM
#1
Thread Starter
Lively Member
[RESOLVED] [2005] Code Signing API (signtool.exe)
Hey Guys,
I am looking for a way to automate the code signing process (signtool.exe) - I need a code signing API.
Does anyone know if there is this sort of functionality is available programmatically?
I know I could execute signtool.exe from code but was looking for a cleaner method, this is what I will use if there are no other options.
Thanks Guys,
Matt.
Last edited by GottaGetITDone; May 24th, 2007 at 07:50 PM.
Reason: Found the answer
-
May 24th, 2007, 06:23 PM
#2
Thread Starter
Lively Member
Re: [2005] Code Signing API (signtool.exe)
I have been looking at the System.Security.Cryptography namespace but I dont think it has the functionality required.
There is a scripting object "Scripting.Signer" and also something called CAPICOM.
Has anyone had any experience in this area?
-
May 24th, 2007, 07:46 PM
#3
Thread Starter
Lively Member
Re: [2005] Code Signing API (signtool.exe)
Problem Solved:
Firstly download the CAPICOM redistributable from Microsoft:
http://www.microsoft.com/downloads/d...displaylang=en
Then a little VB:
Code:
Dim signCode As New CAPICOM.SignedCode
Dim signer As New CAPICOM.Signer
signer.Load("Certificate.pfx", "CertPwd")
signer.Options = CAPICOM.CAPICOM_CERTIFICATE_INCLUDE_OPTION.CAPICOM_CERTIFICATE_INCLUDE_END_ENTITY_ONLY
signCode.FileName = "YourCode.exe"
signCode.Description = "YourDescription"
signCode.Sign(signer)
signCode.Timestamp("http://timestamp.verisign.com/scripts/timestamp.dll")
Your code is now signed.
This is a COM object if anyone knows of a .Net implementation of the CAPICOM library please let me know...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|