Zend Framework
3.0
|
Implementation of the RSA public key encryption algorithm. More...
Public Member Functions | |
__construct (RsaOptions $options=null) | |
Class constructor. | |
setOptions (RsaOptions $options) | |
Set options. | |
getOptions () | |
Get options. | |
getOpensslErrorString () | |
Return last openssl error(s) | |
sign ($data, Rsa\PrivateKey $privateKey=null) | |
Sign with private key. | |
verify ($data, $signature, Rsa\PublicKey $publicKey=null, $mode=self::MODE_AUTO) | |
Verify signature with public key. | |
encrypt ($data, Rsa\AbstractKey $key=null) | |
Encrypt with private/public key. | |
decrypt ($data, Rsa\AbstractKey $key=null, $mode=self::MODE_AUTO) | |
Decrypt with private/public key. | |
generateKeys (array $opensslConfig=[]) | |
Generate new private/public key pair. | |
Static Public Member Functions | |
static | factory ($options) |
RSA instance factory. | |
Public Attributes | |
const | MODE_AUTO = 1 |
const | MODE_BASE64 = 2 |
const | MODE_RAW = 3 |
Protected Attributes | |
$options = null | |
Implementation of the RSA public key encryption algorithm.
__construct | ( | RsaOptions | $options = null | ) |
decrypt | ( | $data, | |
Rsa\AbstractKey | $key = null , |
||
$mode = self::MODE_AUTO |
|||
) |
Decrypt with private/public key.
$data can be encoded in base64 or not. $mode sets how the input must be processed:
string | $data | |
Rsa\AbstractKey | $key | |
int | $mode | Input encoding |
Rsa\Exception\InvalidArgumentException |
encrypt | ( | $data, | |
Rsa\AbstractKey | $key = null |
||
) |
Encrypt with private/public key.
string | $data | |
Rsa\AbstractKey | $key |
Rsa\Exception\InvalidArgumentException |
|
static |
RSA instance factory.
array | Traversable | $options |
Rsa\Exception\RuntimeException | |
Rsa\Exception\InvalidArgumentException |
generateKeys | ( | array | $opensslConfig = [] | ) |
Generate new private/public key pair.
array | $opensslConfig |
Rsa\Exception\RuntimeException |
getOpensslErrorString | ( | ) |
Return last openssl error(s)
getOptions | ( | ) |
Get options.
setOptions | ( | RsaOptions | $options | ) |
sign | ( | $data, | |
Rsa\PrivateKey | $privateKey = null |
||
) |
Sign with private key.
string | $data | |
Rsa\PrivateKey | $privateKey |
Rsa\Exception\RuntimeException |
verify | ( | $data, | |
$signature, | |||
Rsa\PublicKey | $publicKey = null , |
||
$mode = self::MODE_AUTO |
|||
) |
Verify signature with public key.
$signature can be encoded in base64 or not. $mode sets how the input must be processed:
string | $data | |
string | $signature | |
null | Rsa\PublicKey | $publicKey | |
int | $mode | Input encoding |
Rsa\Exception\RuntimeException |
|
protected |
const MODE_AUTO = 1 |
const MODE_BASE64 = 2 |
const MODE_RAW = 3 |