Sample code for 30+ languages & platforms
Visual FoxPro

Example: Crypt2.LastSignerCert method

Demonstrates how to call the LastSignerCert method.

Chilkat Visual FoxPro Downloads

Visual FoxPro
LOCAL lnSuccess
LOCAL loCrypt
LOCAL lcP7m_path
LOCAL lcOut_path
LOCAL lnNumSigners
LOCAL i
LOCAL loCert

lnSuccess = 0

loCrypt = CreateObject('Chilkat.Crypt2')

lcP7m_path = "qa_data/p7m/Firma.docx.p7m"
lcOut_path = "qa_output/Firma.docx"

lnSuccess = loCrypt.VerifyP7M(lcP7m_path,lcOut_path)
IF (lnSuccess = 0) THEN
    ? loCrypt.LastErrorText
    RELEASE loCrypt
    CANCEL
ENDIF

* Examine the certificate(s) used for signing.
lnNumSigners = loCrypt.NumSignerCerts
i = 0

loCert = CreateObject('Chilkat.Cert')

DO WHILE i < lnNumSigners
    loCrypt.LastSignerCert(i,loCert)
    ? "Signer: " + loCert.SubjectDN
    i = i + 1
ENDDO

RELEASE loCrypt
RELEASE loCert