Ruby
Ruby
Example: Crypt2.LastSignerCert method
Demonstrates how to call the LastSignerCert method.Chilkat Ruby Downloads
require 'chilkat'
success = false
crypt = Chilkat::CkCrypt2.new()
p7m_path = "qa_data/p7m/Firma.docx.p7m"
out_path = "qa_output/Firma.docx"
success = crypt.VerifyP7M(p7m_path,out_path)
if (success == false)
print crypt.lastErrorText() + "\n";
exit
end
# Examine the certificate(s) used for signing.
numSigners = crypt.get_NumSignerCerts()
i = 0
cert = Chilkat::CkCert.new()
while i < numSigners
crypt.LastSignerCert(i,cert)
print "Signer: " + cert.subjectDN() + "\n";
i = i + 1
end