Sample code for 30+ languages & platforms
Swift

Example: Crypt2.LastSignerCert method

Demonstrates how to call the LastSignerCert method.

Chilkat Swift Downloads

Swift

func chilkatTest() {
    var success: Bool = false

    let crypt = CkoCrypt2()!

    var p7m_path: String? = "qa_data/p7m/Firma.docx.p7m"
    var out_path: String? = "qa_output/Firma.docx"

    success = crypt.verifyP7M(p7mPath: p7m_path, destPath: out_path)
    if success == false {
        print("\(crypt.lastErrorText!)")
        return
    }

    // Examine the certificate(s) used for signing.
    var numSigners: Int = crypt.numSignerCerts.intValue
    var i: Int = 0

    let cert = CkoCert()!

    while i < numSigners {
        crypt.lastSignerCert(index: i, cert: cert)
        print("Signer: \(cert.subjectDN!)")
        i = i + 1
    }


}