Sample code for 30+ languages & platforms
PHP

Example: Crypt2.ClearSigningCerts method

Demonstrates how to call the ClearSigningCerts method.

Chilkat PHP Downloads

Chilkat2 PHP
<?php

use Chilkat2\BinData;
use Chilkat2\Cert;
use Chilkat2\Crypt2;

$success = false;

$crypt = new Crypt2();
$success = false;

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

$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);

$cert2 = new Cert();
// ...
$crypt->AddSigningCert($cert2);

$cert3 = new Cert();
// ...
$crypt->AddSigningCert($cert3);

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

$crypt->OpaqueSignBd($bd);

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

$cert4 = new Cert();
// ...
$crypt->AddSigningCert($cert4);

$cert5 = new Cert();
// ...
$crypt->AddSigningCert($cert5);

// ...
// ...

// Sign using cert4 and cert5.
$crypt->OpaqueSignBd($bd);