mister-marvin / yii2-rsa
Yii 2 Rsa
Package info
github.com/mister-marvin/yii2-rsa
Type:yii2-extension
pkg:composer/mister-marvin/yii2-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: 2026-03-15 12:18:37 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);