benycode / key-signatory
Validate and sign content with a private and public key
Installs: 72
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/benycode/key-signatory
Requires
- php: ^8.0
This package is not auto-updated.
Last update: 2025-10-27 23:48:11 UTC
README
Validate and sign content with a RSA private and public key
Table of contents
Install
Via Composer
$ composer require benycode/key-signatory
Requires PHP8+.
Usage
Sign a content with a private key
use BenyCode\KeySignatory\Signer; $content = 'a content to be signed'; $privateKey = '-----BEGIN RSA PRIVATE KEY-----<<....>>-----END RSA PRIVATE KEY-----'; $passphrase = ''; $signature = Signer::signWithPrivateKey($content, $privateKey, $passphrase);
Validate a content with a public key
use BenyCode\KeySignatory\Validator; $content = 'a content to be verified'; $publicKey = '-----BEGIN RSA PUBLIC KEY-----<<....>>-----END RSA PUBLIC KEY-----'; $signature = ''; $signature = Validator::validateWithPublicKey($content, $signature, $publicKey);