Sample code for 30+ languages & platforms
PHP Extension

Example: Crypt2.SetSigningCert method

Demonstrates how to call the SetSigningCert method.

Chilkat PHP Extension Downloads

PHP Extension
<?php

include("chilkat.php");

$success = false;

// Signing certificates can be obtained from many different sources..

// Load from a PFX
$cryptA = new CkCrypt2();
$certA = new CkCert();
$success = $certA->LoadPfxFile('c:/someDir/pfx_files/a.pfx','pfx_file_password');
$success = $cryptA->SetSigningCert($certA);
// ...

// Load from a smart card or USB token.
$cryptB = new CkCrypt2();
$certB = new CkCert();
$certB->put_SmartCardPin('123456');
$success = $certB->LoadFromSmartcard('');
$success = $cryptB->SetSigningCert($certB);
// ...

// Load from a the Windows certificate store or macOS keychain
$cryptC = new CkCrypt2();
$certC = new CkCert();
$success = $certC->LoadByCommonName('Xyz 123');
$success = $cryptC->SetSigningCert($certC);
// ...

?>