Skip to content

mhightower/EncryptionClientLib

Repository files navigation

Encryption functions and Key Manager Client

Alliance Key Manager Client

Usage

Requirements

  • Primary Key Manager IP
  • Secondary Key Manager IP
  • Key Name

(Optional)

  • Key Instance Name

Example Usage Code

$manager = new KeyManagerHA::getInstance(['tls://<primary address>:6000', 'tls://<secondary address>:6000'], <CA Cert File Path>, <Client Cert File Path>);
$key = $manager->getKey(<Key Name>, <Optional Key Instance Name>)
$crypt = new Crypt($key);
$cipherText = $crypt->encrypt(<secret>); // $cipherText is ready to put into a database or pass to another service
$instance = $key->getInstance(); // Instance name needs to be saved with the $cipherText data
// To decrypt the encoded information
$key = $manager->getKey(<Key Name>, <Key Instance Name>) // Instance name is mandatory
$crypt = new Crypt($key);
$plainText = $crypt->decrypt($cipherText); // To decrypt the encoded information

About

PHP Encryption Client Library

Topics

Resources

Stars

Watchers

Forks

Contributors