Fully Qualified Name: | Zend\Crypt\PublicKey\Rsa\PublicKey |
Extends: | AbstractKey |
RSA public key
Name | Description | Defined By |
---|---|---|
__construct() | Construct public key with PEM formatted string or X.509 certificate | PublicKey |
__toString() | AbstractKey | |
decrypt() | Decrypt using this key | PublicKey |
encrypt() | Encrypt using this key | PublicKey |
fromFile() | Create public key instance public key from PEM formatted key file or X.509 certificate file | PublicKey |
getCertificate() | Get certificate string | PublicKey |
getOpensslKeyResource() | Retrieve openssl key resource | AbstractKey |
getSize() | Get key size in bits | AbstractKey |
toString() | To string | PublicKey |
Construct public key with PEM formatted string or X.509 certificate
Parameter Name | Type | Description |
---|---|---|
$pemStringOrCertificate | string |
Returns:
Returns: string
Decrypt using this key
Parameter Name | Type | Description |
---|---|---|
$data | string | |
$padding | string |
Returns: string
Encrypt using this key
Starting in 2.4.9/2.5.2, we changed the default padding to OPENSSL_PKCS1_OAEP_PADDING to prevent Bleichenbacher's chosen-ciphertext attack.
Parameter Name | Type | Description |
---|---|---|
$data | string | |
$padding | string |
Returns: string
Create public key instance public key from PEM formatted key file or X.509 certificate file
Parameter Name | Type | Description |
---|---|---|
$pemOrCertificateFile | string |
Returns: \PublicKey
Get certificate string
Returns: string
Retrieve openssl key resource
Returns: resource
Get key size in bits
Returns: int
To string
Returns: string