(Swift) Example: Crypt2.ClearSigningCerts method
Demonstrates how to call the ClearSigningCerts method.
func chilkatTest() {
let crypt = CkoCrypt2()!
var success: Bool = false
// Tell the crypt object to use 3 certificates.
// Do this by calling AddSigningCert for each certificate.
let cert1 = CkoCert()!
// ...
// Load the cert from a source such as a .pfx/.p12 file, smart card, USB token, Apple keychain, Windows certificate store, etc.
// ...
crypt.addSigning(cert1)
let cert2 = CkoCert()!
// ...
crypt.addSigning(cert2)
let cert3 = CkoCert()!
// ...
crypt.addSigning(cert3)
let bd = CkoBinData()!
// ...
success = crypt.opaqueSignBd(bd)
// Let's say we now want to sign something else with different certs..
// First clear the signing certs.
crypt.clearSigningCerts()
let cert4 = CkoCert()!
// ...
crypt.addSigning(cert4)
let cert5 = CkoCert()!
// ...
crypt.addSigning(cert5)
// ...
// ...
// Sign using cert4 and cert5.
success = crypt.opaqueSignBd(bd)
}
|