PHP code example of talk-lucky / dkms
1. Go to this page and download the library: Download talk-lucky/dkms 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/ */
talk-lucky / dkms example snippets
use Dkms\Config;
use Dkms\Dkms;
use Dkms\Models\EncryptRequest;
use Dkms\Models\DecryptRequest;
$config = [];
$configCls = new Config();
$configCls->setProtocol($config["protocol"]);
$configCls->setEndpoint($config["endpoint"]);
$configCls->setPassword($config["password"]);
$configCls->setClientKeyContent($config["clientKeyContent"]);
$configCls->setCainfo($config["cainfo"]);
$client = new Dkms($configCls);
$keyId = "";
$val = "";
$request = new EncryptRequest();
$request->setKeyId($keyId);
$request->setPlaintext($val);
$resp = $client->encrypt($request);
$keyId = "";
$val = "";
$iv = "";
$request = new DecryptRequest();
$request->setKeyId($keyId);
$request->setCiphertextBlob($val);
$request->setIv($iv);
$resp = $client->decrypt($request);
bash
protoc --php_out=./protobuf protobuf/protos/api.proto