WinVerifyTrust, CryptMsgGetParam VB6


Author: Dave
Date: 01.06.14 - 7:19pm



If you want to work with digital signatures in VB6 without capicom, the net is extremely sparse on example code.

With the help of some forums I was able to put together sample code which uses CryptQueryObject, CertFindCertificateInStore, and CryptMsgGetParam to get the certificate issuer and subject, as well as use WinVerifyTrust to determine the status of the files signature.

These have been wrapped in their own modules for clarity. (seeing how hairy the code is to get this information)

You can find complete vb6 examples here:
Example usage:

    Dim v As SigResults, subject As String, issuer As String
    v = VerifyFileSignature(fPath)
    If isSigned(v) Then
        Debug.print "Signature " & SigToStr(v)
        If GetSigner(fPath, issuer, subject) Then
            If Len(subject) > 0 Then Debug.print "Subject:" & subject
            If Len(issuer) > 0 Then  Debug.print "Issuer:" & issuer
        End If
    End If


Thanks to the forum authors especially LaVolpe (Who i even remember from the old school pscode days! Merci!)






Comments: (0)

 
Leave Comment:
Name:
Email: (not shown)
Message: (Required)
Math Question: 23 + 57 = ? followed by the letter: I 



About Me
More Blogs
Main Site
Posts: (All)
2024 ( 1 )
2023 ( 9 )
2022 ( 4 )
2021 ( 2 )
2020 ( 4 )
2019 ( 5 )
2018 ( 6 )
2017 ( 6 )
2016 ( 22 )
2015 ( 15 )
2014 (25)
     Query Last 12 Mos
     Progid from Interface ID
     VB6 to C Array Examples
     Human Readable Variant Type
     ScriptBasic COM Integration
     CodeView Addin
     ScriptBasic - Part 2
     Script Env
     MSCOMCTL Win7 Error
     printf override
     History Combo
     Disable IE
     API Hooking in VB6
     Addin Hook Events
     FastBuild Addin
     VB6 MemoryWindow
     Link C Obj Files into VB6
     Vb6 Standard Dlls
     CStr for Pascal
     Lazarus Review
     asprintf for VS
     VB6 GlobalMultiUse
     Scintilla in VB6
     Dynamic Highlight
     WinVerifyTrust, CryptMsgGetParam VB6
2013 ( 4 )
2012 ( 10 )
2011 ( 7 )
2010 ( 11 )
2009 ( 3 )