Sample code for 30+ languages & platforms
React Native

Example: Crypt2.ClearSigningCerts method

Demonstrates how to call the ClearSigningCerts method.

Chilkat React Native Downloads

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

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

  // Tell the crypt object to use 3 certificates.
  // Do this by calling AddSigningCert for each certificate.

  const cert1 = new Cert();
  // ...
  // 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);

  const cert2 = new Cert();
  // ...
  crypt.addSigningCert(cert2);

  const cert3 = new Cert();
  // ...
  crypt.addSigningCert(cert3);

  const bd = new BinData();
  // ...

  await crypt.opaqueSignBdAsync(bd);

  // Let's say we now want to sign something else with different certs..
  // First clear the signing certs.
  crypt.clearSigningCerts();

  const cert4 = new Cert();
  // ...
  crypt.addSigningCert(cert4);

  const cert5 = new Cert();
  // ...
  crypt.addSigningCert(cert5);

  // ...
  // ...

  // Sign using cert4 and cert5.
  await crypt.opaqueSignBdAsync(bd);
}