Yii 2 Rsa
v0.1.4
2018-01-18 12:42 UTC
Requires
- php: >=5.4.0
- yiisoft/yii2: *
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);