PHP code example of malikzh / php-ncanode

1. Go to this page and download the library: Download malikzh/php-ncanode library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

malikzh / php-ncanode example snippets


$nca = new \Malikzh\PhpNCANode\NCANodeClient('http://127.0.0.1:14579');

$response = $nca->pkcs12Info(p12Base64: $cert, sPassword: 'AAaa1234');
$response->raw();

$response = $nca->pkcs12InfoBulk(p12s: [
    [
        'key' => $p12_1,
        'password' => 'AAaa1234'
    ],
    [
        'key' => $p12_2,
        'password' => 'AAaa1234'
    ],
    # ...
], revocationCheck: ['OCSP'], alias: null);

$response = $nca->pkcs12AliasInfo(p12Base64: $p12, sPassword: 'AAaa1234');

$response = $nca->pkcs12AliasesInfoBulk(p12s: [
    [
        'key' => $p12,
        'password' => 'AAaa1234'
    ],
    # ...
]);

$nca->cmsSign(string $base64data, string $p12, string $certPassword);

$nca->cmsBulkSign(string $base64data, string $p12s);

$nca->cmsSignAdd(string $base64data, string $cmsFilebase64, string $p12, string $certPassword);

$nca->cmsVerify(string $base64data)->isValid();

$nca->cmsExtract($cmsFileBase64);
bash
composer