Sample code for 30+ languages & platforms
React Native

Example: Crypt2.AddPfxSourceBd method

Demonstrates how to call the AddPfxSourceBd method.

Chilkat React Native Downloads

React Native
import { BinData, Crypt2 } from '@chilkat/react-native'

function chilkatExample() {
  const crypt = new Crypt2();

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

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

  const bdPfx = new BinData();
  bdPfx.loadFile('c:/my_pfx_files/a.pfx');
  // ...

  let pfxPassword = 'secret1';
  try {
    crypt.addPfxSourceBd(bdPfx, pfxPassword);
  } catch {
    console.log(crypt.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);
  } catch {
    console.log(crypt.lastErrorText);
    return;
  }

  // ...
  // ...
}