naylonkessler / simple-rsa-cryptor-php
PHP中处理RSA加密的简单工具集
v1.0.0
2018-02-07 12:25 UTC
Requires
- php: >=5.4
Requires (Dev)
- phpunit/phpunit: 5.7
This package is not auto-updated.
Last update: 2024-09-23 07:12:40 UTC
README
PHP中处理RSA加密的简单工具集。
安装
仅使用composer要求此包。
composer require naylonkessler/simple-rsa-cryptor-php
使用此包
仅导入、实例化和调用
<?php use SimpleRSACryptor\Cryptor; use SimpleRSACryptor\Keys\PublicKey; use SimpleRSACryptor\Keys\PrivateKey; $publicKey = new PublicKey('path-to-public-key-file.pem'); $privateKey = new PrivateKey('path-to-private-key-file.pem'); $passPhrase = 'pass phrase of private key'; $cryptor = new Cryptor($publicKey, $privateKey, $passPhrase); $encrypted = $cryptor->encrypt('Some data'); $decrypted = $cryptor->decrypt($encrypted); echo $decrypted;
\SimpleRSACryptor\Cryptor类
待定
\SimpleRSACryptor\Keys\PublicKey类
待定
\SimpleRSACryptor\Keys\PrivateKey类
待定