Fully Qualified Name: | Laminas\Crypt\PublicKey\Rsa |
Implementation of the RSA public key encryption algorithm.
Name | Description | Defined By |
---|---|---|
__construct() | Class constructor | Rsa |
decrypt() | Decrypt with private/public key | Rsa |
encrypt() | Encrypt with private/public key | Rsa |
factory() | RSA instance factory | Rsa |
generateKeys() | Generate new private/public key pair | Rsa |
getOpensslErrorString() | Return last openssl error(s) | Rsa |
getOptions() | Get options | Rsa |
setOptions() | Set options | Rsa |
sign() | Sign with private key | Rsa |
verify() | Verify signature with public key | Rsa |
Class constructor
Parameter Name | Type | Description |
---|---|---|
$options | \RsaOptions |
Returns:
Decrypt with private/public key
$data can be encoded in base64 or not. $mode sets how the input must be processed:
Parameter Name | Type | Description |
---|---|---|
$data | string | |
$key | \Rsa\AbstractKey | |
$mode | int | Input |
Returns: string
Encrypt with private/public key
Parameter Name | Type | Description |
---|---|---|
$data | string | |
$key | \Rsa\AbstractKey |
Returns: string
RSA instance factory
Parameter Name | Type | Description |
---|---|---|
$options | array|\Traversable |
Returns: \Rsa
Generate new private/public key pair
Parameter Name | Type | Description |
---|---|---|
$opensslConfig | array |
Returns: \Rsa Provides a fluent interface
Return last openssl error(s)
Returns: string
Get options
Returns: \RsaOptions
Set options
Parameter Name | Type | Description |
---|---|---|
$options | \RsaOptions |
Returns: \Rsa Provides a fluent interface
Sign with private key
Parameter Name | Type | Description |
---|---|---|
$data | string | |
$privateKey | \Rsa\PrivateKey |
Returns: string
Verify signature with public key
$signature can be encoded in base64 or not. $mode sets how the input must be processed:
Parameter Name | Type | Description |
---|---|---|
$data | string | |
$signature | string | |
$publicKey | null|\Rsa\PublicKey | |
$mode | int | Input |
Returns: bool