Dart
Dart
Example: Crypt2.ClearSigningCerts method
Demonstrates how to call the ClearSigningCerts method.Chilkat Dart Downloads
import 'package:chilkat/chilkat.dart';
void main() {
final crypt = CkCrypt2();
// Tell the crypt object to use 3 certificates.
// Do this by calling AddSigningCert for each certificate.
final cert1 = CkCert();
// ...
// Load the cert from a source such as a .pfx/.p12 file, smart card, USB token, Apple keychain, Windows certificate store, etc.
// ...
crypt.addSigningCert(cert1);
final cert2 = CkCert();
// ...
crypt.addSigningCert(cert2);
final cert3 = CkCert();
// ...
crypt.addSigningCert(cert3);
final bd = CkBinData();
// ...
crypt.opaqueSignBd(bd);
// Let's say we now want to sign something else with different certs..
// First clear the signing certs.
crypt.clearSigningCerts();
final cert4 = CkCert();
// ...
crypt.addSigningCert(cert4);
final cert5 = CkCert();
// ...
crypt.addSigningCert(cert5);
// ...
// ...
// Sign using cert4 and cert5.
crypt.opaqueSignBd(bd);
}