Sometimes it is import to know if a document is signed. To find out if a document contains a mathematically correct signature please use the following code:
DIM PDF
set PDF = createobject("aloahapdf.edit")
msgbox PDF.is_signed(cstr("c:\inputpdf.pdf"))
set PDF = nothing
Even more important than just knowing if a document is signed it is to know WHO signed it. With the following example it is possible to extract all certificate chains of all mathematically correct signatures. Those chains can then subsequently used to do revocation checks etc.
Please note that this API requires an enterprise license!
Dim pdf As Object
Dim signers As Variant
Dim i As Long
Dim ii As Long
Dim signer As Object
on error resume next
Err.Clear
If UBound(signers) > 0 Then
If Err.Number = 0 Then
For i = 1 To UBound(signers)
Set signer = Nothing
Set signer = signers(i).signers
If signer.Count > 0 Then
For ii = 1 To signer.Count
MsgBox signer(ii).certificate.subjectname
Next ii
End If
Next i
End If
End If