SSLPrivateKey objects are containers for private key data.
Table 4.654. SSLPrivateKey Class Method Overview
Method |
Except? |
Description |
---|---|---|
Y |
Creates the SSLPrivateKey object from the filename argument passed. | |
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 the version of the private key. | |
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 filename argument passed.
new SSLPrivateKey(filename, [passphrase]
)
$pkey = new SSLPrivateKey("/etc/keys/key.pem");
Table 4.655. Arguments for SSLPrivateKey::constructor()
Argument |
Type |
Description |
---|---|---|
|
String |
The filename of the PEM-encoded private key file |
|
String |
The passphrase required to decrypt the private key |
Table 4.656. Return Values for SSLPrivateKey::constructor()
Return Type |
Description |
---|---|
Object |
The SSLPrivateKey object is returned |
Table 4.657. Exceptions thrown by SSLPrivateKey::constructor()
err |
desc |
---|---|
|
missing filename argument, can't open file, unable to parse file, etc |
Destroys the SSLPrivateKey object.
delete lvalue
delete $pkey;
Table 4.658. Arguments for SSLPrivateKey::destructor()
Argument |
Type |
Description |
---|---|---|
n/a |
n/a |
This method takes no arguments. |
Table 4.659. Return Values for SSLPrivateKey::destructor()
Return Type |
Description |
---|---|
n/a |
This method returns no value |
Copying objects of this class is not supported, an exception will be thrown.
Table 4.660. 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.
SSLPrivateKey::getType()
$str = $pkey.getType();
Table 4.661. Arguments for SSLPrivateKey::getType()
Argument |
Type |
Description |
---|---|---|
n/a |
n/a |
This method takes no arguments. |
Table 4.662. Return Values for SSLPrivateKey::getType()
Return Type |
Description |
---|---|
String |
Returns values include: RSA, RSA2, DSA, DSA1, DSA2, DSA3, DSA4, DH, and unknown |
Returns the version of the private key as an integer.
SSLPrivateKey::getVersion()
$int = $pkey.getVersion();
Table 4.663. Arguments for SSLPrivateKey::getVersion()
Argument |
Type |
Description |
---|---|---|
n/a |
n/a |
This method takes no arguments. |
Table 4.664. Return Values for SSLPrivateKey::getVersion()
Return Type |
Description |
---|---|
Integer |
The version of the private key. |
Returns the bit length of the private key.
SSLPrivateKey::getBitLength()
$int = $pkey.getBitLength();
Table 4.665. Arguments for SSLPrivateKey::getBitLength()
Argument |
Type |
Description |
---|---|---|
n/a |
n/a |
This method takes no arguments. |
Table 4.666. Return Values for SSLPrivateKey::getBitLength()
Return Type |
Description |
---|---|
Integer |
The bit length of the private key. |
Returns a hash of all information for the private key.
SSLPrivateKey::getInfo()
$hash = $pkey.getInfo();
Table 4.667. Arguments for SSLPrivateKey::getInfo()
Argument |
Type |
Description |
---|---|---|
n/a |
n/a |
This method takes no arguments. |
Table 4.668. Return Values for SSLPrivateKey::getInfo()
Return Type |
Description |
---|---|
Hash |
Keys are 'type', 'version', and 'bitLength' corresponding to the algorithm type, the version, and the bit length of the key respectively. |