Greetings,
I am using CAPICOM.dll in vb.net 2010 to check the validity of any digitally signed file's signature.
Following are the codes i'm using :
Above code is working fine to check if the file (exe) is containing a digital signature OR not.
Now, the problem is when I am checking this code with a file (which has fake digital signature), it is showing "Valid Signature"
Where I am doing wrong? Please suggest me. How can I check if the exe is containing a valid signature.
Thanks
Regards,
I am using CAPICOM.dll in vb.net 2010 to check the validity of any digitally signed file's signature.
Following are the codes i'm using :
Code:
Dim signed As New CAPICOM.SignedCode
signed.FileName = cFilname
Try
Dim cert = signed.Certificates(1)
cert.IsValid.CheckFlag = CAPICOM_CHECK_FLAG.CAPICOM_CHECK_TRUSTED_ROOT Or _
CAPICOM_CHECK_FLAG.CAPICOM_CHECK_TIME_VALIDITY Or _
CAPICOM_CHECK_FLAG.CAPICOM_CHECK_SIGNATURE_VALIDITY Or _
CAPICOM_CHECK_FLAG.CAPICOM_CHECK_ONLINE_REVOCATION_STATUS
If cert.IsValid.Result Then
TextBox2.Text &= "VALID" & vbNewLine
Else
TextBox2.Text &= "NOT VALID" & vbNewLine
End If
Catch
TextBox2.Text &= "NOT VALID" & vbNewLine
End Try
Now, the problem is when I am checking this code with a file (which has fake digital signature), it is showing "Valid Signature"
Where I am doing wrong? Please suggest me. How can I check if the exe is containing a valid signature.
Thanks
Regards,