Sample code for 30+ languages & platforms
C#

Example: Crypt2.LastSignerCert method

Demonstrates how to call the LastSignerCert method.

Chilkat C# Downloads

C#
bool success = false;

Chilkat.Crypt2 crypt = new Chilkat.Crypt2();

string p7m_path = "qa_data/p7m/Firma.docx.p7m";
string out_path = "qa_output/Firma.docx";

success = crypt.VerifyP7M(p7m_path,out_path);
if (success == false) {
    Debug.WriteLine(crypt.LastErrorText);
    return;
}

//  Examine the certificate(s) used for signing.
int numSigners = crypt.NumSignerCerts;
int i = 0;

Chilkat.Cert cert = new Chilkat.Cert();

while (i < numSigners) {
    crypt.LastSignerCert(i,cert);
    Debug.WriteLine("Signer: " + cert.SubjectDN);
    i = i + 1;
}