PHP code example of garyr / portunus
1. Go to this page and download the library: Download garyr/portunus 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/ */
garyr / portunus example snippets
// callback to deliver private key
$callback = function($safeName) {
// this should return your private key
return $myPrivateKeyBytes;
};
$Agent = new Portunus\Application\Agent();
$Agent->setSafe('dev');
$Agent->setPrivateKeyCallback($callback);
// retrieve decrypted value 'bar'
$value = $Agent->getKey('foo');