\fastRsa

RSA签名类

Summary

Methods
Properties
Constants
__construct()
setKey()
privEncrypt()
privDecrypt()
pubEncrypt()
pubDecrypt()
sign()
verify()
__destruct()
$publicKey
$privateKey
No constants found
No protected methods found
No protected properties found
N/A
setupPrivKey()
setupPubKey()
$_privKey
$_pubKey
$_keyPath
N/A

Properties

$publicKey

$publicKey : 

Type

$privateKey

$privateKey : 

Type

$_privKey

$_privKey : 

Type

$_pubKey

$_pubKey : 

* private key

Type

$_keyPath

$_keyPath : 

* public key

Type

Methods

__construct()

__construct(  $publicKey = null,   $privateKey = null) 

* the construtor,the param $path is the keys saving path

Parameters

$publicKey
$privateKey

setKey()

setKey(string  $publicKey = null, string  $privateKey = null) 

设置公钥和私钥

Parameters

string $publicKey

公钥

string $privateKey

私钥

privEncrypt()

privEncrypt(  $data) 

* encrypt with the private key

Parameters

$data

privDecrypt()

privDecrypt(  $encrypted) 

* decrypt with the private key

Parameters

$encrypted

pubEncrypt()

pubEncrypt(  $data) 

* encrypt with public key

Parameters

$data

pubDecrypt()

pubDecrypt(  $crypted) 

* decrypt with the public key

Parameters

$crypted

sign()

sign(string  $dataString) : string

构造签名

Parameters

string $dataString

被签名数据

Returns

string

verify()

verify(string  $dataString, string  $signString) : \fast\number

验证签名

Parameters

string $dataString

被签名数据

string $signString

已经签名的字符串

Returns

\fast\number —

1签名正确 0签名错误

__destruct()

__destruct() 

setupPrivKey()

setupPrivKey() 

* setup the private key

setupPubKey()

setupPubKey() 

* setup the public key