Sample code for 30+ languages & platforms
Dart

Example: Crypt2.AddPfxSourceBd method

Demonstrates how to call the AddPfxSourceBd method.

Chilkat Dart Downloads

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

void main() {
  final crypt = CkCrypt2();

  // Do public-key decryption (RSA)
  crypt.cryptAlgorithm = 'pki';

  // ...
  // ...
  // ...

  final bdPfx = CkBinData();
  bdPfx.loadFile('c:/my_pfx_files/a.pfx');
  // ...

  var pfxPassword = 'secret1';
  try {
    crypt.addPfxSourceBd(bdPfx, pfxPassword);
  } on ChilkatException catch (e) {
    print(e.lastErrorText);
    return;
  }

  // Add as many as PFX sources as desired...
  bdPfx.loadFile('c:/my_pfx_files/b.pfx');
  pfxPassword = 'secret2';
  try {
    crypt.addPfxSourceBd(bdPfx, pfxPassword);
  } on ChilkatException catch (e) {
    print(e.lastErrorText);
    return;
  }

  // ...
  // ...
}