Go
Go
Example: Crypt2.LastSignerCert method
Demonstrates how to call the LastSignerCert method.Chilkat Go Downloads
success := false
crypt := chilkat.NewCrypt2()
p7m_path := "qa_data/p7m/Firma.docx.p7m"
out_path := "qa_output/Firma.docx"
success = crypt.VerifyP7M(p7m_path,out_path)
if success == false {
fmt.Println(crypt.LastErrorText())
crypt.DisposeCrypt2()
return
}
// Examine the certificate(s) used for signing.
numSigners := crypt.NumSignerCerts()
i := 0
cert := chilkat.NewCert()
for i < numSigners {
crypt.LastSignerCert(i,cert)
fmt.Println("Signer: ", cert.SubjectDN())
i = i + 1
}
crypt.DisposeCrypt2()
cert.DisposeCert()