Zend Framework
3.0
|
RSA private key. More...
Public Member Functions | |
__construct ($pemString, $passPhrase=null) | |
Constructor. | |
getPublicKey () | |
Get the public key. | |
encrypt ($data, $padding=OPENSSL_PKCS1_PADDING) | |
Encrypt using this key. | |
decrypt ($data, $padding=OPENSSL_PKCS1_OAEP_PADDING) | |
Decrypt using this key. | |
toString () | |
Public Member Functions inherited from AbstractKey | |
getSize () | |
Get key size in bits. | |
getOpensslKeyResource () | |
Retrieve openssl key resource. | |
encrypt ($data) | |
Encrypt using this key. | |
decrypt ($data) | |
Decrypt using this key. | |
toString () | |
Get string representation of this key. | |
__toString () | |
Static Public Member Functions | |
static | fromFile ($pemFile, $passPhrase=null) |
Create private key instance from PEM formatted key file. | |
Protected Attributes | |
$publicKey = null | |
Protected Attributes inherited from AbstractKey | |
$pemString = null | |
$opensslKeyResource = null | |
$details = [] | |
Additional Inherited Members | |
Public Attributes inherited from AbstractKey | |
const | DEFAULT_KEY_SIZE = 2048 |
RSA private key.
__construct | ( | $pemString, | |
$passPhrase = null |
|||
) |
Constructor.
string | $pemString | |
string | $passPhrase |
Exception\RuntimeException |
decrypt | ( | $data, | |
$padding = OPENSSL_PKCS1_OAEP_PADDING |
|||
) |
Decrypt 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.
string | $data | |
integer | $padding |
Exception\RuntimeException | |
Exception\InvalidArgumentException |
encrypt | ( | $data, | |
$padding = OPENSSL_PKCS1_PADDING |
|||
) |
Encrypt using this key.
string | $data | |
integer | $padding |
Exception\RuntimeException | |
Exception\InvalidArgumentException |
|
static |
Create private key instance from PEM formatted key file.
string | $pemFile | |
string | null | $passPhrase |
Exception\InvalidArgumentException |
getPublicKey | ( | ) |
Get the public key.
toString | ( | ) |
|
protected |