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

  • Home
  • SEARCH
  • 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 8390325
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T18:57:13+00:00 2026-06-09T18:57:13+00:00

I am having issues when calling CryptUIWizDigitalSign to programatically sign an executable with our

  • 0

I am having issues when calling CryptUIWizDigitalSign to programatically sign an executable with our public code signing certificate, without showing any UI. The certificate is a Comodo code signing certificate.

It works fine when the timestamp URL parameter is set to null, but whenever I pass anything other than null in, the call fails (returns zero).

The problem is that without a timestamp, there is no countersignature, and so there are signature validity problems further down the line.

Environment is Windows 7 x64. There is a working standard internet connection. It appears from sniffing the network traffic that no attempt is made by CryptUIWizDigitalSign to contact the timestamp server.

I am calling this from .NET via a PInvoke, but I doubt that would make any difference.

Not a lot on the net about this function…

Dim cert As X509Certificate2 = New X509Certificate2("mycert.pfx", "password")
Dim pSigningCertContext As IntPtr = cert.Handle

Dim digitalSignInfo As CRYPTUI_WIZ_DIGITAL_SIGN_INFO 
    = New CRYPTUI_WIZ_DIGITAL_SIGN_INFO
digitalSignInfo.dwSize = Marshal.SizeOf(digitalSignInfo)
digitalSignInfo.dwSubjectChoice = CRYPTUI_WIZ_DIGITAL_SIGN_SUBJECT_FILE
digitalSignInfo.pwszFileName = "C:\temp\installer.exe"
digitalSignInfo.dwSigningCertChoice = CRYPTUI_WIZ_DIGITAL_SIGN_CERT
digitalSignInfo.pSigningCertContext = pSigningCertContext
digitalSignInfo.pwszTimestampURL = "http://timestamp.comodoca.com/authenticode"
digitalSignInfo.dwAdditionalCertChoice = 0
digitalSignInfo.pSignExtInfo = IntPtr.Zero

If (Not CryptUIWizDigitalSign(CRYPTUI_WIZ_NO_UI, IntPtr.Zero, vbNullString, 
                              digitalSignInfo, pSignContext)) Then
    Throw New Win32Exception(Marshal.GetLastWin32Error(), 
        "CryptUIWizDigitalSign")
End If

The CRYPTUI_WIZ_DIGITAL_SIGN_INFO type is defined as:

<StructLayout(LayoutKind.Sequential)> _
Public Structure CRYPTUI_WIZ_DIGITAL_SIGN_INFO
    Public dwSize As Int32
    Public dwSubjectChoice As Int32
    <MarshalAs(UnmanagedType.LPWStr)> Public pwszFileName As String
    Public dwSigningCertChoice As Int32
    Public pSigningCertContext As IntPtr
    Public pwszTimestampURL As String
    Public dwAdditionalCertChoice As Int32
    Public pSignExtInfo As IntPtr
End Structure

Public Const CRYPTUI_WIZ_DIGITAL_SIGN_SUBJECT_FILE As Int32 = 1
Public Const CRYPTUI_WIZ_DIGITAL_SIGN_CERT As Int32 = 1
Public Const CRYPTUI_WIZ_NO_UI As Int32 = 1
  • 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. Editorial Team
    Editorial Team
    2026-06-09T18:57:14+00:00Added an answer on June 9, 2026 at 6:57 pm

    Fixed – works only within a 32 bit process.

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

Sidebar

Related Questions

I've been working on our intro scripting assignment, and am having issues calling functions
I am not having any issues with logging in or even calling the api,
I am having issues calling an ASP.NET web service in JQuery. I am basically
I'm having some performance issues calling CGContextDrawLayerAtPoint in iOS 4 that didn't seem to
I've been having some issues with calling -becomeFirstResponder on a UITextField contained with a
As an overview, I'm having issues with a UINavigationController inside of a UITabBarController calling
Having issues calling the ReportingService2005.FindItems() method from within powershell v2. $rs = New-WebServiceProxy -Uri
I'm trying to do my first pyopengl program but having some issues when calling
I'm having issues with some jQuery code I have. Using $.each I am looping
I have been having issues calling a background image in my CSS file. The

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.