Chilkat.PublicKey PHP ActiveX Reference

Chilkat.PublicKey

* This is a freeware class/component/library.

Represents an RSA public key. Provides methods for importing and exporting to/from OpenSSL DER and PEM formats, RSA DER format, and XML format. Public keys can be imported/exported to both memory and files.

Object Creation

$obj = new COM("Chilkat.PublicKey");

Properties

string LastErrorHtml (read-only)

Error information in HTML format for the last method called.

string LastErrorText (read-only)

Error information in plain-text format for the last method called.

string LastErrorXml (read-only)

Error information in XML format for the last method called.

Methods

VARIANT GetOpenSslDer()

Gets the public key in OpenSSL DER format.

Returns 1 for success, 0 for failure.

string GetOpenSslPem()

Gets the public key in OpenSSL PEM format.

Returns a null on failure

VARIANT GetRsaDer()

Gets the public key in RSA DER format.

Returns 1 for success, 0 for failure.

string GetXml()

Gets the public key in XML format. The XML has this format where the key parts are base64 encoded:

<RSAKeyValue>
  <Modulus>...</Modulus>
  <Exponent>...</Exponent>
</RSAKeyValue>

Returns a null on failure

bool LoadOpenSslDer(VARIANT derData)

Loads a public key from in-memory OpenSSL DER formatted byte data.

Returns 1 for success, 0 for failure.

bool LoadOpenSslDerFile(string filename)

Loads a public key from an OpenSSL DER format file.

Returns 1 for success, 0 for failure.

bool LoadOpenSslPem(string pemStr)

Loads a public key from an OpenSSL PEM string.

Returns 1 for success, 0 for failure.

bool LoadOpenSslPemFile(string filename)

Loads a public key from an OpenSSL PEM file.

Returns 1 for success, 0 for failure.

int LoadPkcs1Pem(string str)

To be documented soon...

bool LoadRsaDer(VARIANT derData)

Loads a public key from in-memory RSA DER formatted byte data.

Returns 1 for success, 0 for failure.

bool LoadRsaDerFile(string filename)

Loads a public key from an RSA DER formatted file.

Returns 1 for success, 0 for failure.

bool LoadXml(string xml)

Loads a public key from an XML string.

Returns 1 for success, 0 for failure.

bool LoadXmlFile(string filename)

Loads a public key from an XML file.

Returns 1 for success, 0 for failure.

bool SaveLastError(string filename)

Saves the last error information to an XML formatted file.

bool SaveOpenSslDerFile(string filename)

Saves the public key to an OpenSSL DER format file.

Returns 1 for success, 0 for failure.

bool SaveOpenSslPemFile(string filename)

Saves the public key to an OpenSSL PEM format file.

Returns 1 for success, 0 for failure.

bool SaveRsaDerFile(string filename)

Saves the public key to an RSA DER format file.

Returns 1 for success, 0 for failure.

bool SaveXmlFile(string filename)

Saves the public key to an XML file.

Returns 1 for success, 0 for failure.