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)
|