Back to product page

PrivateKey property


Holds private key.

Type

A String value

Syntax

  • Basic
object.PrivateKey(KeyType) [= value]
The PrivateKey(object,KeyType,Value) syntax has these parts:
objectAn expression evaluating to an object of type Keys.
KeyTypeRequired. A SSHKeyTypes enumeration, as described in settings. Type of the key.
ValueA String value.

Remarks

The settings for KeyType are:

Constant Value Description
RSAkey 0 Uses RSA key.
DSAkey 1 Uses DSA key.
ECDSAkey 2 Uses ECDSA key.


PrivateKey property is used if you don't want to call internal Load and Save methods to preserve key data between sessions. Once you Generate new key, you can retrieve it's raw data using this property, and store it somewhere depending what your needs are. Obtaining private key data this way does not encrypt it in any way - you should do it by yourself when you store the key.

In later sessions, you can easily load your key internally, and put it in PrivateKey property and wodKeys will immediately be able to use it. KeyType must be specified to determine what key is stored/retrieved.

Note that setting PrivateKey with unexpected data may result in wodKeys rejecting your key. It is advised to set PrivateKey only with data you have previously retrieved from the same property (in previous session).

Platforms

Windows