Yii 2 Rsa

安装次数: 16

依赖者: 0

建议者: 0

安全性: 0

星标: 0

关注者: 2

分支: 0

类型:yii2-extension

v0.1.4 2018-01-18 12:42 UTC

This package is not auto-updated.

Last update: 2024-09-29 05:01:46 UTC


README

rsa

getKey

	$rsa = Yii::$app->rsa;
	$k = $rsa->generateKey();
	print_r($k['public_key']);
	print_r($k['private_key']);

config

'components' => [

'rsa'=>[
		'class' => 'mistermarvin\rsa\Rsa',
		'public_key' => $params['rsa']['publicKey'],
		'private_key' => $params['rsa']['privateKey'],
],
....

]

use

$rsa = Yii::$app->rsa;
$data = $rsa->encrypt('hello rsa');
echo $rsa->decrypt($data);