Qore Programming Language Reference Manual
1.8.0
|
This class implements a container for private key data. More...
Public Member Methods | |
constructor (string pem, *string pass) | |
Creates the SSLPrivateKey object from the PEM-encoded text representation of the private key passed. More... | |
constructor (binary der) | |
Creates the SSLPrivateKey object from the data argument passed. More... | |
copy () | |
Returns a copy of the private key object. More... | |
int | getBitLength () |
Returns the bit length of the private key. More... | |
binary | getDER () |
Returns a binary object in DER format representing the private key. More... | |
hash< auto > | getInfo () |
Returns a hash of all information for the private key. More... | |
string | getPEM () |
Returns a string in PEM format representing the private key. More... | |
string | getType () |
Returns a string giving the algorithm used for the private key. More... | |
int | getVersion () |
Returns a constant value of 1; do not use; only included for backwards-compatibility. More... | |
Public Member Methods inherited from Qore::Serializable | |
constructor () | |
The constructor does not perform any action; this class is just used to mark a class as serializable by inheriting this class. | |
copy () | |
The copy constructor does not perform any action; this class is just used to mark a class as serializable by inheriting this class. | |
serialize (OutputStream stream) | |
converts the object to binary data representing the object More... | |
binary | serialize () |
converts the object to binary data representing the object More... | |
hash< SerializationInfo > | serializeToData () |
converts the object to a serialization hash representing the object More... | |
Additional Inherited Members | |
Static Public Member Methods inherited from Qore::Serializable | |
static auto | deserialize (InputStream stream) |
Deserializes data produced with serialize() and returns the value represented by the data. More... | |
static auto | deserialize (binary bin) |
Deserializes data produced with serialize() and returns the value represented by the data. More... | |
static auto | deserialize (string bin) |
Deserializes data produced with serialize() and returns the value represented by the data. More... | |
static auto | deserialize (hash< SerializationInfo > data) |
Deserializes data produced with serializeToData() and returns the value represented by the data. More... | |
static hash< SerializationInfo > | deserializeToData (InputStream stream) |
Deserializes data produced with serialize() and returns the value represented by the data. More... | |
static hash< SerializationInfo > | deserializeToData (binary bin) |
Deserializes data produced with serialize() and returns the value represented by the data. More... | |
static | serialize (auto val, OutputStream stream) |
serializes the data and writes the serialized data to the given output stream More... | |
static binary | serialize (auto val) |
serializes the data and returns the serialized data as a binary object More... | |
static hash< SerializationInfo > | serializeToData (auto val) |
converts the value to a serialization hash representing the value More... | |
This class implements a container for private key data.
The SSLPrivateKey class supports data serialization; note that the serialized data is a representation of the data that does not require a password, so for source data that requires a password to use, the serialized representation of the private key should be protected carefully (transmitted only in an encrypted stream)
Qore::SSLPrivateKey::constructor | ( | binary | der | ) |
Creates the SSLPrivateKey object from the data argument passed.
der | The DER-encoded binary representation of the private key |
SSLPRIVATEKEY-CONSTRUCTOR-ERROR | error in private key data |
Creates the SSLPrivateKey object from the PEM-encoded text representation of the private key passed.
pem | The PEM-encoded text representation of the private key |
pass | The optional password or passphrase for the private key |
SSLPRIVATEKEY-CONSTRUCTOR-ERROR | error in private key data |
Qore::SSLPrivateKey::copy | ( | ) |
Returns a copy of the private key object.
int Qore::SSLPrivateKey::getBitLength | ( | ) |
Returns the bit length of the private key.
binary Qore::SSLPrivateKey::getDER | ( | ) |
Returns a binary object in DER format representing the private key.
SSLPRIVATEKEY-ERROR | could not create DER data from private key data |
hash<auto> Qore::SSLPrivateKey::getInfo | ( | ) |
Returns a hash of all information for the private key.
"type"
: The type of private key (see SSLPrivateKey::getType())"version"
: The version of the private key (see SSLPrivateKey::getVersion())"bitLength"
: The bit length of the private key (see SSLPrivateKey::getBitLength())string Qore::SSLPrivateKey::getPEM | ( | ) |
Returns a string in PEM format representing the private key.
SSLPRIVATEKEY-ERROR | could not create PEM string from private key data |
string Qore::SSLPrivateKey::getType | ( | ) |
Returns a string giving the algorithm used for the private key.
"RSA"
, "RSA2"
, "DSA"
, "DSA1"
, "DSA2"
, "DAS3"
, "DAS4"
, "DH"
, "unknown"
)int Qore::SSLPrivateKey::getVersion | ( | ) |
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.