Sample code for 30+ languages & platforms
Dart

Example: Crypt2.SetSigningCert method

Demonstrates how to call the SetSigningCert method.

Chilkat Dart Downloads

Dart
import 'package:chilkat/chilkat.dart';

void main() {
  // Signing certificates can be obtained from many different sources..

  // Load from a PFX
  final cryptA = CkCrypt2();
  final certA = CkCert();
  certA.loadPfxFile('c:/someDir/pfx_files/a.pfx', 'pfx_file_password');
  cryptA.setSigningCert(certA);
  // ...

  // Load from a smart card or USB token.
  final cryptB = CkCrypt2();
  final certB = CkCert();
  certB.smartCardPin = '123456';
  certB.loadFromSmartcard('');
  cryptB.setSigningCert(certB);
  // ...

  // Load from a the Windows certificate store or macOS keychain
  final cryptC = CkCrypt2();
  final certC = CkCert();
  certC.loadByCommonName('Xyz 123');
  cryptC.setSigningCert(certC);
  // ...
}