Skip to content

symflex/openssl-component

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OpenSSL

PHP from Packagist Codecov Packagist Version

Installation

Package is available on Packagist, you can install it using Composer.

composer require symflex/openssl-component

Dependencies

  • PHP 7.4
  • OpenSSL Extension

Usage

use Symflex\Component\OpenSSL\Key\PemPublicKey;
use Symflex\Component\OpenSSL\Key\PemPrivateKey;
...

$publicKey  = new PemPublicKey('file:///path_to_file');
$privateKey = new PemPrivateKey('file:///path_to_file', 'passphrase');

or

use Symflex\Component\OpenSSL\Factory\Key\PemKeyFactory;
...

$keyFactory = new \Symflex\Component\OpenSSL\Factory\Key\PemKeyFactory();
$publicKey  = $keyFactory->createPublicKey('file:///path_to_file');
$privateKey = $keyFactory->createPrivateKey('file:///path_to_file', 'passphrase');
use Symflex\Component\OpenSSL\Signature\Algorithm\Rsa\Sha256;

$data = 'test string';

$opensslSigner = new Sha256($publicKey, $privateKey);
$signature = $opensslSigner->sign($data);

$opensslSigner->verify($data, $signature);

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages