SSLPrivateKey objects are containers for private key data.
Table 4.528. SSLPrivateKey Class Method Overview
|
Method |
Except? |
Description |
|---|---|---|
|
|
Y |
Creates the SSLPrivateKey object from the data argument passed; as a deprecated, backwards-compatibilty extension, if the string variant is used and a string less then 120 bytes long is passed, it is taken as a filename to use to load the private key data from in PEM format. In this case |
|
N |
Destroys the SSLPrivateKey object. | |
|
Y |
Copying objects of this class is not supported, an exception will be thrown. | |
|
N |
Returns the algorithm used for the private key. | |
|
N |
Returns a constant 1; do not use; only included for backwards compatibility. | |
|
N |
Returns the bit length of the private key. | |
|
N |
Returns a hash of all information for the private key. |
Creates the SSLPrivateKey object from the data argument passed.
As a deprecated, backwards-compatibilty extension, if the string variant is used and a string less then 120 bytes long is passed, it is taken as a filename to use to load the private key data from in PEM format. In this case PO_NO_FILESYSTEM is checked at run-time; if set, and exception is thrown. Do not use this feature; load the file first and pass the data to the constructor instead. This functionality will be removed in a future release of Qore.
SSLPrivateKey::constructor(string $key_pem, string $pass = "")
SSLPrivateKey::constructor(binary $key_der)
my SSLPrivateKey $pkey($data);
Table 4.530. Exceptions thrown by SSLPrivateKey::constructor()
|
err |
desc |
|---|---|
|
|
invalid format, invalid or missing password, etc |
Destroys the SSLPrivateKey object.
delete $pkey;
Copying objects of this class is not supported, an exception will be thrown.
Table 4.531. Exceptions thrown by SSLPrivateKey::copy()
|
err |
desc |
|---|---|
|
|
objects of this class may not be copied |
Returns a string giving the algorithm used for the private key.
$str = $pkey.getType();
Table 4.532. Return Values for SSLPrivateKey::getType()
|
Return Type |
Description |
|---|---|
|
Returns values include: RSA, RSA2, DSA, DSA1, DSA2, DSA3, DSA4, DH, and unknown |
Returns a constant value of 1; do not use; only included for backwards-compatibility.
The openssl library never put any usable value into the internal fields that were used to provide this information; newer versions of openssl do not expose this information at all, therefore this method now returns a constant value of 1 for backwards-compatibility.
$int = $pkey.getVersion();
Table 4.533. Return Values for SSLPrivateKey::getVersion()
|
Return Type |
Description |
|---|---|
|
Always returns a value of 1. |
Returns the bit length of the private key.
$int = $pkey.getBitLength();
Table 4.534. Return Values for SSLPrivateKey::getBitLength()
|
Return Type |
Description |
|---|---|
|
The bit length of the private key. |