PHP code example of bc-automotive / master-api-client

1. Go to this page and download the library: Download bc-automotive/master-api-client 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/ */

    

bc-automotive / master-api-client example snippets


use \BcAutomotive\MasterApiClient\MasterApiClient;

$client = new MasterApiClient($apiKey);

$data = file_get_contents('/path/to/data.bdc');
$encrypted = $client->encrypt($data, $slaveName);
file_put_contents('/path/to/data.sbdc', $encrypted['data']);


use \BcAutomotive\MasterApiClient\MasterApiClient;

$client = new MasterApiClient($apiKey);

$data = file_get_contents('/path/to/data.sbdc');
$decrypted = $client->decrypt($data);
file_put_contents('/path/to/data.sbdc', $decrypted['data']);


use MasterApiClient;

$encrypted = MasterApiClient::encrypt($data, $slaveName);
$decrypted = MasterApiClient::decrypt($data);