![]() |
Chilkat HOME Android™ AutoIt C C# C++ Chilkat2-Python CkPython Classic ASP DataFlex Delphi DLL Go Java Node.js Objective-C PHP Extension Perl PowerBuilder PowerShell PureBasic Ruby SQL Server Swift Tcl Unicode C Unicode C++ VB.NET VBScript Visual Basic 6.0 Visual FoxPro Xojo Plugin
(Swift) Example: Crypt2.ClearEncryptCerts methodDemonstrates how to call the ClearEncryptCerts method.
func chilkatTest() { let crypt = CkoCrypt2()! // Tell the crypt object to use 3 certificates. // Do this by calling AddEncryptCert 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.addEncryptCert(cert1) let cert2 = CkoCert()! // ... crypt.addEncryptCert(cert2) let cert3 = CkoCert()! // ... crypt.addEncryptCert(cert3) // Params for public-key encryption to create PKCS7 enveloped-data crypt.cryptAlgorithm = "pki" crypt.pkcs7CryptAlg = "aes" crypt.keyLength = 256 crypt.oaepHash = "sha256" crypt.oaepPadding = true let bd = CkoBinData()! // ... var success: Bool = crypt.encryptBd(bd) // Let's say we now want to encrypt something else with different certs.. // First clear the encryption certs. crypt.clearEncryptCerts() let cert4 = CkoCert()! // ... crypt.addEncryptCert(cert4) let cert5 = CkoCert()! // ... crypt.addEncryptCert(cert5) // ... // ... // Encrypt using cert4 and cert5. success = crypt.encryptBd(bd) } |
© 2000-2025 Chilkat Software, Inc. All Rights Reserved.