PHP code example of ncrypt-site / php-sdk

1. Go to this page and download the library: Download ncrypt-site/php-sdk 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/ */

    

ncrypt-site / php-sdk example snippets


use NCrypt\Client\Api\NCryptAPI;
use NCrypt\Client\Library\RequestBuilder\RequestBuilder;

r();
$request = $requestBuilder->prepareSecureNoteRequest('Your Very Secure Note', 1, false);
try {
    $result = $api->notePost($request->getNoteRequest());
    echo 'Note URL is: ' . $result->getData()->getUrl() . PHP_EOL;
    echo 'You can unseal the note with this key: ' . $request->getSecureNote()->getKey() . PHP_EOL;
} catch (Exception $e) {
    echo $e->getMessage();
}
bash
composer