Class Rsa

Summary

Fully Qualified Name: Zend\Crypt\PublicKey\Rsa

Description

Implementation of the RSA public key encryption algorithm.

Methods

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

Method Details

__construct()

Class constructor

Parameter Name Type Description
$options \RsaOptions

Returns:

decrypt()

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()

Encrypt with private/public key

Parameter Name Type Description
$data string
$key \Rsa\AbstractKey

Returns: string

factory()

RSA instance factory

Parameter Name Type Description
$options array|\Traversable

Returns: \Rsa

generateKeys()

Generate new private/public key pair

Parameter Name Type Description
$opensslConfig array

Returns: \Rsa Provides a fluent interface

getOpensslErrorString()

Return last openssl error(s)

Returns: string

getOptions()

Get options

Returns: \RsaOptions

setOptions()

Set options

Parameter Name Type Description
$options \RsaOptions

Returns: \Rsa Provides a fluent interface

sign()

Sign with private key

Parameter Name Type Description
$data string
$privateKey \Rsa\PrivateKey

Returns: string

verify()

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

Top