You are on page 1of 37

WeOnlyDo Keys Component Helpfile

wodKeys help
Table of contents
Page

Title

WeOnlyDo! COM Keys Component Introduction

License Agreement

Objects

Enumerations Object

SSHKeyTypes Enumeration

10

Keys Object

11

Keys Methods

12

FromXmlString method

13

Generate method

15

Load method

17

PublicKeyLoad method

18

PublicKeySave method

19

Save method

20

ToXmlString method

21

Keys Properties

22

BitCount property

23

BubbleBabble property

24

FingerPrint property

25

FingerPrintData property

26

PrivateKey property

27

PrivateKeyData property

29

PublicKey property

30

PublicKeyData property

31

PublicKeyOpenSSH property

32

PublicKeyRSA1 property

33

PublicKeySSH property

34

Version property

35

How to get support

wodKeys Table of contents

Page 2 of 37

36

Technical information

37

Error list

wodKeys Table of contents

Page 3 of 37

wodKeys help - Introduction

WeOnlyDo! COM Keys Component Introduction


General Information
wodKeys is a component that deals with private and public keys needed for WeOnlyDo! SSH related components. It allows you to generate, load, save... keys that
will be used for your authentication with the server.
wodKeys cannot be used separate from other WeOnlyDo! product, thus is not shipped or sold separately. It is included in setup packages where is needed.
Component is lightweight, and is not required for distribution of applications you make. If you prefer to use "static keys", you can use wodKeys to generate them
once, and then just bind them to your projects.

Platforms
Windows

wodKeys Introduction

Page 4 of 37

wodKeys help - License Agreement

License Agreement
WeOnlyDo! SOFTWARE LICENSE AGREEMENT
This is a legal agreement between you (either an individual or an entity) and WeOnlyDo! Software ("WeOnlyDo!"). By installing the enclosed software, you are
agreeing to be bound by the terms of this Agreement. If you do not agree to the terms of this Agreement, promptly return the software and the accompanying items to
the place you obtained them for a full refund. If you need to return the software, you must prepay shipping and either insure the package or assume all risk of loss or
damage in transit.
WeOnlyDo! LICENSE
1. GRANT OF LICENSE TO USE. The WeOnlyDo! Software product that accompanies this license is referred to herein as "SOFTWARE." WeOnlyDo! Software
("WeOnlyDo") grants to you as an individual, a personal, non-exclusive license to make and use the SOFTWARE for the sole purpose of designing, developing, and
testing your software product(s). WeOnlyDo! Software grants to you the limited right to use only one copy of the Software on a single computer in the manner set forth
in this agreement. If you are an entity, WeOnlyDo! Software grants you the right to designate one individual within your organization to have the right to use the
SOFTWARE in the manner provided above. WeOnlyDo! Software reserves all rights not expressly granted.
2. UPDATES. Upon receipt of future updates of the SOFTWARE (including without limitation the Redistributable Code)(an "UPDATE"), you may use or transfer the
UPDATE only in conjunction with your then-existing SOFTWARE. The SOFTWARE and all UPDATES (including bug fixes and error corrections) shall be provided by
WeOnlyDo! To you and are licensed as a single product, and the UPDATES may not be separated from the SOFTWARE for use by more than one user at any time.
3. COPYRIGHT. The SOFTWARE is owned by WeOnlyDo! Software or its suppliers and is protected by copyright laws and international treaty provisions. Therefore,
you must treat the SOFTWARE like any other copyrighted material (e.g., a book or musical recording). You may not use or copy the SOFTWARE or any accompanying
written materials for any purposes other than what is described in this Agreement. WeOnlyDo! warrants that WeOnlyDo! is the sole owner of all patents, copyrights or
other applicable intellectual property rights in and to the SOFTWARE unless otherwise indicated in the documentation for the SOFTWARE. WeOnlyDo! shall defend,
indemnify, and hold Licensee harmless from any third party claims, including reasonable attorneys' fees, alleging that Software (including without limitation Sample
Code) licensed hereunder infringes or misappropriates third party intellectual property rights.
4. OTHER RESTRICTIONS. You may not rent or lease the SOFTWARE, but you may transfer the SOFTWARE and accompanying written materials on a permanent
basis, provided you retain no copies and the recipient agrees to the terms of this Agreement. You may not reverse-engineer, decompile, or disassemble the
SOFTWARE except to the extent such foregoing restriction is expressly prohibited by applicable law.
5. REDISTRIBUTABLE CODE. Portions of the SOFTWARE (specifically the run time modules in binary form) are designated as "Redistributable Code", subject to the
Distribution Requirements described below.
6. SAMPLE CODE. WeOnlyDo! Software grants you the right to use and modify the source code version of the included Sample Code for the sole purpose of
designing, developing, testing and supporting your software products. You may also reproduce and distribute the Sample Code in object code form along with any
modifications you make to the Sample Code, provided that you comply with the Distribution Requirements described below. For purposes of this section,
"modifications" shall mean enhancements to the functionality of the Sample Code.
7. SOURCE CODE. If you have purchased the SOFTWARE source code, you may not re-distribute the source code, nor may you copy it into your own projects.
WeOnlyDo! retains the copyright to the SOFTWARE source code. You have no right to change or use source code for 3rd party components or applications. Source
code is provided only for your storage and protection. This agreement allows you to obtain access to fix and update the software's source code under special
circumstances, such as to provide support to your end user customers to whom you have distributed Redistributable Code in conformance with Section 8 below, or
if the WeOnlyDo! Software goes out of business.
8. DISTRIBUTION REQUIREMENTS. Notwithstanding section 4 above, you are authorized to redistribute the Sample Code and/or Redistributable Code, (collectively
"REDISTRIBUTABLE COMPONENTS") as described in Sections 5 and 6, only if you
(a) distribute them in conjunction with and as part of your software product that adds primary and significant functionality to the REDISTRIBUTABLE COMPONENTS ;
(b) do not permit further redistribution of the REDISTRIBUTABLE COMPONENTS by your end-user customers ;
(c) do not use WeOnlyDo! Software's name, logo, or trademarks to market your software application product ;
(d) include a valid copyright notice on your software product ; and
(e) agree to indemnify, hold harmless, and defend WeOnlyDo! Software from and against any third party claims or lawsuits, including reasonable attorney's fees, to
the extent arising or resulting from your material breach of your obligations under this agreement.
WeOnlyDo! Software reserves all rights not expressly granted. The license in this section to distribute REDISTRIBUTABLE COMPONENTS is royalty-free, provided
that you do not make any modifications to any of the REDISTRIBUTABLE COMPONENTS. Contact WeOnlyDo! Software for the applicable royalties due and other
licensing terms for all other uses and/or distribution of the REDISTRIBUTABLE COMPONENTS.
LIMITED WARRANTY
NO WARRANTIES. WeOnlyDo! Software expressly disclaims any warranty for the SOFTWARE. The SOFTWARE and any related documentation is provided "as is"
without warranty of any kind, either express or implied, including, without limitation, the implied warranties or merchantability or fitness for a particular purpose. The
entire risk arising out of use or performance of the SOFTWARE remains with you.
CUSTOMER REMEDIES. Each party's entire liability under this license agreement shall not exceed the price paid for the SOFTWARE. NO LIABILITY FOR
CONSEQUENTIAL DAMAGES. In no event shall WeOnlyDo! Software, its suppliers or you be liable for any damages whatsoever (including, without limitation,
damages for loss of business profits, business interruptions, loss of business information, or any other pecuniary loss) arising out of the use or inability to use this
wodKeys License Agreement

Page 5 of 37

WeOnlyDo! Software product, even if such party has been advised of the possibility of such damages. The limitations and disclaimers set forth in this section do not
apply to
[a] either party's obligations of indemnity stated herein or
[b] to your material breach of your obligations under this license agreement.
DEMO. The demo versions of our products are intended for evaluation purposes only. You may not use the demo version to develop completed applications.
This agreement is protected by copyright laws and international treaty provisions. If you do not agree to the terms of the license agreement, you are not allowed to
use this product or any part of it. Should you have any questions concerning this product, contact WeOnlyDo! Inc.

Platforms
Windows

wodKeys License Agreement

Page 6 of 37

wodKeys help - Objects

Objects
Enumerations

List of enumerations supported by wodKeys.

Keys

Main wodKeys object.

Platforms
Windows

wodKeys Objects

Page 7 of 37

wodKeys help - Enumerations

Enumerations Object
List of enumerations supported by wodKeys.

SSHKeyTypes

List of available key types used by wodKeys.

Platforms
Windows

wodKeys Enumerations

Page 8 of 37

wodKeys help - SSHKeyTypes

SSHKeyTypes Enumeration
List of available key types used by wodKeys.

Remarks
SSH2 protocol specification defines RSAcipher as default, and it should be supported by all clients/servers, so it is advised you should use it. However, there are
servers that prefer DSAalgorithm to be used (due to RSApatent, which has in the meantime expired). EC (Elliptic Curve algorithms have been added in 2013).
Generate and Load methods support all of these types.
List of available key types used by wodKeys:
Constant

Value

Description

RSAkey

Uses RSAalgorithm to create keys.

DSAkey

Uses DSAalgorithm to create keys.

ECDSAkey

Uses ECDSAalgorithm to create keys.

Platforms
Windows

wodKeys Enumerations SSHKeyTypes

Page 9 of 37

wodKeys help - Keys

Keys Object
Main wodKeys object.

Methods

FromXmlString

Reconstructs an RSA/DSAkey from an XML string.

Generate

Generate new pair of keys.

Load

Loads keys from the file.

PublicKeyLoad

Loads public key from the file.

PublicKeySave

Saves public key a the file.

Save

Saves keys to the file.

ToXmlString

Creates and returns an XML string representation of the current RSA/DSAkey.

Properties

BitCount

Determines number of bits in the key.

BubbleBabble

Returns BubbleBabble printout of the key, as string expression.

FingerPrint

Returns fingerprint of the private key, as string expression.

FingerPrintData

Returns fingerprint of the private key, as byte array.

PrivateKey

Holds private key.

PrivateKeyData

Holds private key - as byte array.

PublicKey

Returns public key.

PublicKeyData

Returns public key - as byte array.

PublicKeyOpenSSH

Returns public key in OpenSSH format.

PublicKeyRSA1

Returns public key in SSH1 RSAformat.

PublicKeySSH

Returns public key in SSH format.

Version

Holds component version number.

Platforms
Windows

wodKeys Keys

Page 10 of 37

wodKeys help - Methods

Keys Methods
FromXmlString

Reconstructs an RSA/DSAkey from an XML string.

Generate

Generate new pair of keys.

Load

Loads keys from the file.

PublicKeyLoad

Loads public key from the file.

PublicKeySave

Saves public key a the file.

Save

Saves keys to the file.

ToXmlString

Creates and returns an XML string representation of the current RSA/DSAkey.

Platforms
Windows

wodKeys Keys Methods

Page 11 of 37

wodKeys help - FromXmlString

FromXmlString method
Reconstructs an RSA/DSAkey from an XML string.

Type
None

Syntax
Basic

object.FromXmlString XmlData
The FromXmlString method syntax has these parts:
object

An expression evaluating to an object of type Keys.

XmlData

Required. AString value. XML data that represent RSA/DSAkey.

Remarks
FromXmlString method will try to decode RSA/DSAkey (both public and private, when possible) from given XML string, as it is exported by MS NET framework.
Typically, your XML representation of the key will look like this:
<RSAKeyValue><Modulus>ySvYlf2fjZTitchU0XJ4KU1jCy0O2bwaz6K3OK6NiC6Io43H7L7nCFuj+q
FwW9Mrs1CTNp8e5TAsTtAH9PMOixYghWTK8t6EqutyctNa9GEb6qdi6CuPMmF/qMbvu3EtWp80qBgt1l
........
hSE4AeOt6eS5UefNkjuJXPllYKp4znIPcC1eMWYyud6sLbeKYbsMM2e+AOqAloNR0zys9S3rhi5Nj4d+
I65gNXs9C0bNIE=</D></RSAKeyValue>
This method will replace current RSA/DSAkey with new one. You can Save this key once it is imported, or can directly use it in your applications.
To convert back to XML format, you can use ToXmlString method.

Platforms
Windows

wodKeys Keys FromXmlString

Page 12 of 37

wodKeys help - Generate

Generate method
Generate new pair of keys.

Type
None

Syntax
Basic

object.Generate KeyType, [BitCount]


The Generate method syntax has these parts:
object

An expression evaluating to an object of type Keys.

KeyType

Required. A SSHKeyTypes enumeration, as described in settings. Type of the key.

BitCount

Optional. AVariant value. Specifies total number of bits in generated key (defaults to 1024).

Remarks
The settings for KeyType are:
Constant

Value

Description

RSAkey

Uses RSAalgorithm to create keys.

DSAkey

Uses DSAalgorithm to create keys.

ECDSAkey

Uses ECDSAalgorithm to create keys.

Generate method should be called when you need to generate new key to be used with the server. KeyType should be set to RSAkey, DSAkey or ECDSAkey. Old (if
any) key loaded in memory will be destroyed, and new one will take it's place. It is advised that immediately after new key is generated, you should Save it to a file for
future use.
Generate method can be a lengthy process, especially if you set large BitCount value (default BitCount is 1024). It is advised you make random mouse movements,
or type on the keyboard during the keys generation, to get more random values for new keys. Possible bitcount values for generating new keys are 768, 1024
(default), 2048 and 3072 (for RSAand DSA), and 256, 384 and 521 for ECDSAkey.
If you with to transfer your existing keys from OpenSSH (or similar) SSH server, you can easily load such keys using Load method. In such case there is no need to
generate new pair of keys.
Important thing is to keep the key private and unreadable by anyone else except yourself. To help you accomplish this, storing generated keys can optionally be
protected using a Password in Save method.

Code sample
Basic

Typical scenario to deal with generating/loading/saving keys would be something like this (sample in VB):
wodKeys Keys Generate

Page 13 of 37

Private Sub Form_Load()


Dim Filename As String
Dim Password As String

' initialize Keys component


Dim Keys As New WODSSHKeyLib.Keys
' first we need to load or generate key we will use
' just for the sample, one is enough.
On Error Resume Next

Filename = App.Path + "\mykey.rsa"


' we don't need to put password at all - but it's better in real life
Password = "My secret password"
' try to load the key
Keys.Load Filename, Password
If Err <> 0 Then
' load failed - we will generate new one
Keys.Generate RSAkey
Keys.Save RSAkey, Filename, Password
End If

' now you can continue with your code


End Sub

Platforms
Windows

wodKeys Keys Generate

Page 14 of 37

wodKeys help - Load

Load method
Loads keys from the file.

Type
None

Syntax
Basic

object.Load Filename, [Password]


The Load method syntax has these parts:
object

An expression evaluating to an object of type Keys.

Filename

Required. AString value. Full path to file where key is stored.

Password

Optional. AVariant value. Secret password used to protect the key.

Remarks
Load method will try to load in memory previously saved key using Save method, or saved using external programs such as ssh-keygen included in OpenSSH
package. File should be accessible and readable by yourself in the time when Load is requested.
If Load is successful, wodKeys will recognize key type (RSAkey, DSAkey or ECDSAkey) and overwrite old one from memory (if any). If you use more than one key, you
should call Load method more than once, specifying different file in each call.
Saved key should be in PEM format. PEM format is simply base64 encoded data surrounded by header lines (this is the format that is used in Save method) and is
widely supported by different SSH implementations. Load additionally transparently handle PKCS#8 format encrypted and unencrypted keys too. Typical structure
looks like this (for RSAKey):
-----BEGIN RSAPRIVATE KEY----Proc-Type: 4,ENCRYPTED
DEK-Info: DES-EDE3-CFB,33E78EDBC3F91072
bKxPNDjHoqW4wT46OnYnDWtJnhwhqRIh81o9IAjjrrlRRDQf9kefDFuciKBrJCqK
................................................................
(...more...)
................................................................
ViWBhtNOV1Wzm3Ifv9ekm6cd1TjPO2UP/Vi5/Xz4PQ+maA7c1QXbdXGF29fc2VFI
JQKZxKKEfirZntyOH6chDQGeYnB7mXLpRNnNb7g=
-----END RSAPRIVATE KEY----If loading fails, an error will be generating describing the error. Most common error when loading the key will occur if password does not match one that was used
when key was saved.
Besides opening PEM format, Load method will try to open Putty, Vandyke, SSH1.0, SSH.COM and F-Secure generated keys. Also, it will try to open PFX files
(PKCS#12 format) and try to find any private keys in that file. When saved, these keys will be saved in PEM format. You may need to remove passphrase from foreign
keys when you try to import them with Load method!
Note: since version 1.1.2.9 Load method can accept also string representation of the key. This allows you to keep the key in your application, rather than external file.
Only PEM format is supported this way. So, you can use code like this, it will work:

Dim key As WODSSHKeyLib.Keys


Dim KeyData As String
wodKeys Keys Load

Page 15 of 37

KeyData = "-----BEGIN RSA PRIVATE KEY-----" & vbCrLf & _


"MIICWgIBAAKBgQC3cmHl8c2qdVP3Vn7FBXB/U/D+P/HI0daomwIIxqxQp7f4gGbY" & vbCrLf & _
"IUt1cntQD1qa2qSmBDQC7ZL8Ihn11l+fwhrt4p/7H5YcimIyjM6gtAoU7TVWg+ji" & vbCrLf & _
....
"m9fDlSj9Eq75nzAcwt4/BmqmJ/8Ei2sLGHw/6HlW" & vbCrLf & _
"-----END RSA PRIVATE KEY-----"
Set key = New Keys
key.Load KeyData

Platforms
Windows

wodKeys Keys Load

Page 16 of 37

wodKeys help - PublicKeyLoad

PublicKeyLoad method
Loads public key from the file.

Type
None

Syntax
Basic

object.PublicKeyLoad Filename
The PublicKeyLoad method syntax has these parts:
object

An expression evaluating to an object of type Keys.

Filename

Required. AString value. Full path to file where key is stored.

Remarks
PublicKeyLoad method will try to Load public key in memory. It cannot be used directly by wodSSH/wodSFTP (or any other WeOnlyDo! product), but can be used to
convert public keys (generated by 3rd party software) to OpenSSH or SSH format, as required by SSH servers.
Public key should be in X509 PEM format. PEM format is simply base64 encoded data surrounded by header lines (this is the format that is used in Save method)
and is widely supported by different SSH implementations. Typical structure looks like this:
-----BEGIN PUBLIC KEY----bKxPNDjHoqW4wT46OnYnDWtJnhwhqRIh81o9IAjjrrlRRDQf9kefDFuciKBrJCqK
................................................................
(...more...)
................................................................
ViWBhtNOV1Wzm3Ifv9ekm6cd1TjPO2UP/Vi5/Xz4PQ+maA7c1QXbdXGF29fc2VFI
JQKZxKKEfirZntyOH6chDQGeYnB7mXLpRNnNb7g=
-----END PUBLIC KEY-----

Platforms
Windows

wodKeys Keys PublicKeyLoad

Page 17 of 37

wodKeys help - PublicKeySave

PublicKeySave method
Saves public key a the file.

Type
None

Syntax
Basic

object.PublicKeySave KeyType, Filename


The PublicKeySave method syntax has these parts:
object

An expression evaluating to an object of type Keys.

KeyType

Required. A SSHKeyTypes enumeration, as described in settings. Type of the key.

Filename

Required. AString value. Full path to file where key should be PublicKeySaved.

Remarks
The settings for KeyType are:
Constant

Value

Description

RSAkey

Saves RSAkey.

DSAkey

Saves DSAkey.

ECDSAkey

Saves ECDSAkey.

PublicKeySave method will store contents of your public key from memory to file on your disk drive, in X509 PEM format.
Key is saved using PEM format, as base64 encoded data surrounded by header lines, which makes it exportable (and importable) to other SSH engines. Written file
contains only plain ASCII characters.

Platforms
Windows

wodKeys Keys PublicKeySave

Page 18 of 37

wodKeys help - Save

Save method
Saves keys to the file.

Type
None

Syntax
Basic

object.Save KeyType, Filename, [Password]


The Save method syntax has these parts:
object

An expression evaluating to an object of type Keys.

KeyType

Required. A SSHKeyTypes enumeration, as described in settings. Type of the key.

Filename

Required. AString value. Full path to file where key should be saved.

Password

Optional. AVariant value. Secret password to protect the key.

Remarks
The settings for KeyType are:
Constant

Value

Description

RSAkey

RSAkey is saved.

DSAkey

DSAkey is saved.

ECDSAkey

ECDSAkey is saved.

Save method will store contents of your private key from memory to file on your disk drive.
Key is saved using PEM format, as base64 encoded data surrounded by header lines, which makes it exportable (and importable) to other SSH engines. Optionally
(and is suggested) you can specify the password to be used when key is written to disk, so only you can read saved key. Don't forget to use the same password
when Loading key from disk.
Written file contains only plain ASCII characters.

Platforms
Windows

wodKeys Keys Save

Page 19 of 37

wodKeys help - ToXmlString

ToXmlString method
Creates and returns an XML string representation of the current RSA/DSAkey.

Type
None

Syntax
Basic

object.ToXmlString(KeyType, IncludePrivate)
The ToXmlString method syntax has these parts:
object

An expression evaluating to an object of type Keys.

KeyType

Required. A SSHKeyTypes enumeration, as described in settings. Type of the key (RSA/DSA).

IncludePrivate

Required. ABoolean value that determine if private key is also exported. If set to False then only public part is exported.

Remarks
The settings for KeyType are:
Constant

Value

Description

RSAkey

Exports RSAkey.

DSAkey

Exports DSAkey.

This method will return XML string expression of public or private RSA/DSAkey, so it can be reused by MS NET framework directly.

Platforms
Windows

wodKeys Keys ToXmlString

Page 20 of 37

wodKeys help - Properties

Keys Properties
BitCount

Determines number of bits in the key.

BubbleBabble

Returns BubbleBabble printout of the key, as string expression.

FingerPrint

Returns fingerprint of the private key, as string expression.

FingerPrintData

Returns fingerprint of the private key, as byte array.

PrivateKey

Holds private key.

PrivateKeyData

Holds private key - as byte array.

PublicKey

Returns public key.

PublicKeyData

Returns public key - as byte array.

PublicKeyOpenSSH

Returns public key in OpenSSH format.

PublicKeyRSA1

Returns public key in SSH1 RSAformat.

PublicKeySSH

Returns public key in SSH format.

Version

Holds component version number.

Platforms
Windows

wodKeys Keys Properties

Page 21 of 37

wodKeys help - BitCount

BitCount property
Determines number of bits in the key.

Type
An Integer value

Syntax
Basic

object.BitCount(KeyType)
The BitCount property syntax has these parts:
object

An expression evaluating to an object of type Keys.

KeyType

Required. A SSHKeyTypes enumeration, as described in settings. Type of the key.

Remarks
The settings for KeyType are:
Constant

Value

Description

RSAkey

Sets/returns bitcount for RSAkey.

DSAkey

Sets/returns bitcount for DSAkey.

ECDSAkey

Sets/returns bitcount for ECDSAkey.

This property will return number of bits in specified private key. Number of bits for each key is specified in Generate method when key is created. Most common
value is 1024, but for stronger encryption sometimes this value can be larger.
For ECDSAkey supported values are 256, 384 and 521.

Platforms
Windows

wodKeys Keys BitCount

Page 22 of 37

wodKeys help - BubbleBabble

BubbleBabble property
Returns BubbleBabble printout of the key, as string expression.

Type
AString value

Syntax
Basic

object.BubbleBabble(KeyType)
The BubbleBabble property syntax has these parts:
object

An expression evaluating to an object of type Keys.

KeyType

Required. A SSHKeyTypes enumeration, as described in settings. Type of the key.

Remarks
The settings for KeyType are:
Constant

Value

Description

RSAkey

Returns bubble babble for RSAkey.

DSAkey

Returns bubble babble for DSAkey.

ECDSAkey

Returns bubble babble for ECDSAkey.

This property will return BubbleBabble printout of the key. BubbleBabble is almost readable form of private key, usually in form similar to this:
xonib-lakon-gynuf-byvoz-cymuv-saseh-gimek-ripuf-vicig-madov-coxix
it is used to test key easier since text representation is similar to words.

Platforms
Windows

wodKeys Keys BubbleBabble

Page 23 of 37

wodKeys help - FingerPrint

FingerPrint property
Returns fingerprint of the private key, as string expression.

Type
AString value

Syntax
Basic

object.FingerPrint(KeyType, [DigestType])
The FingerPrint property syntax has these parts:
object

An expression evaluating to an object of type Keys.

KeyType

Required. A SSHKeyTypes enumeration, as described in settings. Type of the key.

DigestType

Optional. AVariant value. Type of digest algorithm (MD5 or SHA1).

Remarks
The settings for KeyType are:
Constant

Value

Description

RSAkey

Returns fingerprint for RSAkey.

DSAkey

Returns fingerprint for DSAkey.

ECDSAkey

Returns fingerprint for ECDSAkey.

FingerPrint method will return string of length 16 or 20 characters, that hold almost unique fingerprint for the requested key.
Fingerprints are used when there is a need to determine if some keys match (are the same). Since keys can be pretty large, checking if some keys match is pretty
hard to do. Therefore when client wants to be sure of server's identity, it can connect to the server, check server's fingerprint information, and check if if match with the
value previously stored locally. If client is connecting for the first time then there's no way of checking for stored values, so the client must decide whether he will trust
received key or not. Client can ask server's maintainer (through some private channel, like telephone for example) to send fingerprint information about some key
and then on each connection test if it matches received key. 20 byte fingerprint is much easier to test than few hundreds bytes that are actually contained in each key.
Digest algorithms MD5 or SHA1 are used to calculate 20 byte fingerprint which is different for each key.
You can use this method to read fingerprint information for some key, and you can, for example, publicly announce it on your webpage (or similar place), so users
that connect can be sure that they are connecting to proper server and no one is tampering on your connection.
Instead of String expression, you can read fingerprint data also as byte array, using FingerPrintData property.

Platforms
Windows

wodKeys Keys FingerPrint

Page 24 of 37

wodKeys help - FingerPrintData

FingerPrintData property
Returns fingerprint of the private key, as byte array.

Type
AVariant value.

Syntax
Basic

object.FingerPrintData(KeyType, [DigestType])
The FingerPrintData property syntax has these parts:
object

An expression evaluating to an object of type Keys.

KeyType

Required. A SSHKeyTypes enumeration, as described in settings. Type of the key.

DigestType

Optional. AVariant value. Type of digest algorithm (MD5 or SHA1).

Remarks
The settings for KeyType are:
Constant

Value

Description

RSAkey

Returns fingerprint for RSAkey.

DSAkey

Returns fingerprint for DSAkey.

ECDSAkey

Returns fingerprint for ECDSAkey.

FingerPrint method will return byte array of 16 or 20 characters length, that hold almost unique fingerprint for the requested key.
Fingerprints are used when there is a need to determine if some keys match (are the same). Since keys can be pretty large, checking if some keys match is pretty
hard to do. Therefore when client wants to be sure of server's identity, it can connect to the server, check server's fingerprint information, and check if if match with the
value previously stored locally. If client is connecting for the first time then there's no way of checking for stored values, so the client must decide whether he will trust
received key or not. Client can ask server's maintainer (through some private channel, like telephone for example) to send fingerprint information about some key
and then on each connection test if it matches received key. 20 byte fingerprint is much easier to test than few hundreds bytes that are actually contained in each key.
Digest algorithms MD5 or SHA1 are used to calculate 20 byte fingerprint which is different for each key.
You can use this method to read fingerprint information for some key, and you can, for example, publicly announce it on your webpage (or similar place), so users
that connect can be sure that they are connecting to proper server and no one is tampering on your connection.
Instead of byte array, you can read fingerprint data also as a String expression, using FingerPrint property.

Platforms
Windows

wodKeys Keys FingerPrintData

Page 25 of 37

wodKeys help - PrivateKey

PrivateKey property
Holds private key.

Type
AString value

Syntax
Basic

object.PrivateKey(KeyType) [= value]
The PrivateKey property syntax has these parts:
object

An expression evaluating to an object of type Keys.

KeyType

Required. A SSHKeyTypes enumeration, as described in settings. Type of the key.

Value

AString value.

Remarks
The settings for KeyType are:
Constant

Value

Description

RSAkey

Uses RSAkey.

DSAkey

Uses DSAkey.

ECDSAkey

Uses ECDSAkey.

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

wodKeys Keys PrivateKey

Page 26 of 37

wodKeys help - PrivateKeyData

PrivateKeyData property
Holds private key - as byte array.

Type
An array of Byte values

Syntax
Basic

object.PrivateKeyData(KeyType) [= value]
The PrivateKeyData property syntax has these parts:
object

An expression evaluating to an object of type Keys.

KeyType

Required. A SSHKeyTypes enumeration, as described in settings. Type of the key.

value()

An array of Byte values.

Remarks
The settings for KeyType are:
Constant

Value

Description

RSAkey

Uses RSAkey.

DSAkey

Uses DSAkey.

ECDSAkey

Uses ECDSAkey.

PrivateKeyData 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 (or PrivateKey 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 PrivateKeyData property and wodKeys will immediately be able to use it. KeyType must be
specified to determine what key is stored/retrieved.
Note that setting PrivateKeyData with unexpected data may result in wodKeys rejecting your key. It is advised to set PrivateKeyData only with data you have previously
retrieved from the same property (in previous session).
We have noticed that when MFC generates wrappers for wodKeys, it says it cannot generate wrapper for this member. Well, you should then just add it by yourself. In
header file, add this line:
void GetPrivateKeyData(long KeyType, SAFEARRAY **result);
void SetPrivateKeyData(long KeyType, SAFEARRAY **DataArray);

and in wrapper implementation file, add this


void IKeys::GetPrivateKeyData(long KeyType, SAFEARRAY **result)
{
wodKeys Keys PrivateKeyData

Page 27 of 37

VARIANT var;
var.vt = VT_VARIANT;
static BYTE parms[] = VTS_I4;
InvokeHelper(0xc, DISPATCH_PROPERTYGET, VT_VARIANT, (void*)&var, parms, KeyType);
*result = (SAFEARRAY *)var.punkVal;
}
void IKeys::SetPrivateKeyData(long KeyType, SAFEARRAY **DataArray)
{
VARIANT var;
var.vt = VT_UI1 | VT_ARRAY;
var.parray = *DataArray;
static BYTE parms[] = VTS_I4 VTS_VARIANT;
InvokeHelper(0xc, DISPATCH_PROPERTYPUT, VT_EMPTY, NULL, parms, KeyType, &var);
}

Platforms
Windows

wodKeys Keys PrivateKeyData

Page 28 of 37

wodKeys help - PublicKey

PublicKey property
Returns public key.

Type
AString value

Syntax
Basic

object.PublicKey(KeyType)
The PublicKey property syntax has these parts:
object

An expression evaluating to an object of type Keys.

KeyType

Required. ASSHKeyTypes enumeration, as described in settings. Type of the key.

Remarks
The settings for KeyType are:
Constant

Value

Description

RSAkey

Uses RSAkey.

DSAkey

Uses DSAkey.

ECDSAkey

Uses ECDSAkey.

This property will return raw data for public part of previously generated (or loaded) key.

Platforms
Windows

wodKeys Keys PublicKey

Page 29 of 37

wodKeys help - PublicKeyData

PublicKeyData property
Returns public key - as byte array.

Type
An array of Byte values

Syntax
Basic

object.PublicKeyData(KeyType)
The PublicKeyData property syntax has these parts:
object

An expression evaluating to an object of type Keys.

KeyType

Required. A SSHKeyTypes enumeration, as described in settings. Type of the key.

Remarks
This property will return raw data for public part of previously generated (or loaded) key. Unlike PublicKey property which returns String, this property returns byte
array.
We have noticed that when MFC generates wrappers for wodKeys, it says it cannot generate wrapper for this member. Well, you should then just add it by yourself. In
header file, add this line:
void GetPublicKeyData(long KeyType, SAFEARRAY **result);
and in wrapper implementation file, add this
void IKeys::GetPublicKeyData(long KeyType, SAFEARRAY **result)
{
VARIANT var;
var.vt = VT_VARIANT;
static BYTE parms[] = VTS_I4;
InvokeHelper(0xd, DISPATCH_PROPERTYGET, VT_VARIANT, (void*)&var, parms, KeyType);
*result = (SAFEARRAY *)var.punkVal;
}

Platforms
Windows

wodKeys Keys PublicKeyData

Page 30 of 37

wodKeys help - PublicKeyOpenSSH

PublicKeyOpenSSH property
Returns public key in OpenSSH format.

Type
AString value

Syntax
Basic

object.PublicKeyOpenSSH(KeyType)
The PublicKeyOpenSSH property syntax has these parts:
object

An expression evaluating to an object of type Keys.

KeyType

Required. ASSHKeyTypes enumeration, as described in settings. Type of the key.

Remarks
The settings for KeyType are:
Constant

Value

Description

RSAkey

Uses RSAkey.

DSAkey

Uses DSAkey.

ECDSAkey

Uses ECDSAkey.

PublicKeyOpenSSH will return string information that represents stored public key in format suitable for OpenSSH servers. Typically, it will look like this:
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAIEA8AYkMFyO5RLtAtWh5/NeveIh4vv6l/p1V5gKhfnj8uz36KrEEMn..............
You can easily paste contents of this property to file on your server system that keeps public keys. Usually, this is -/.ssh/authorized_keys2 file.

Platforms
Windows

wodKeys Keys PublicKeyOpenSSH

Page 31 of 37

wodKeys help - PublicKeyRSA1

PublicKeyRSA1 property
Returns public key in SSH1 RSAformat.

Type
AString value

Syntax
Basic

object.PublicKeyRSA1
The PublicKeyRSA1 property syntax has these parts:
object

An expression evaluating to an object of type Keys.

Remarks
PublicKeyRSA1 will return string information that represents stored public key in format suitable for SSH1 servers. It can be used only for RSAkeys, since SSH1
server only support RSAcipher authenticaion.
Typically, it will look like this:
1024 35 1491447565979391620804974425532607679275854098033229 ....
You can easily paste contents of this property to file on your server system that keeps public keys (try -/.ssh/authorized_keys).

Platforms
Windows

wodKeys Keys PublicKeyRSA1

Page 32 of 37

wodKeys help - PublicKeySSH

PublicKeySSH property
Returns public key in SSH format.

Type
AString value

Syntax
Basic

object.PublicKeySSH(KeyType)
The PublicKeySSH property syntax has these parts:
object

An expression evaluating to an object of type Keys.

KeyType

Required. A SSHKeyTypes enumeration, as described in settings. Type of the key (RSA/DSA).

Remarks
The settings for KeyType are:
Constant

Value

Description

RSAkey

Returns RSAkey.

DSAkey

Returns DSAkey.

ECDSAkey

Returns ECDSAkey.

PublicKeySSH will return string information that represents stored public key in format suitable for SSH servers. Typically, it will look like this:
---- BEGIN SSH2 PUBLIC KEY ---AAAAB3NzaC1kc3MAAACBAKzHYPgw/VvUWHooW0iyKYPYVfaTZSDlHZaUEsHOAvdln+6aQw
..........
oRi1V/3n//AAypdXkAN8BSBrsb4V4AVdzHpvXSdHh9C+TlRUH1Ls72Kl929+4jMZmWDXGw
O5ns8NPAJZvOxnZKZA==
---- END SSH2 PUBLIC KEY ---You can easily paste contents of this property to file on your server system that keeps public keys.

Platforms
Windows

wodKeys Keys PublicKeySSH

Page 33 of 37

wodKeys help - Version

Version property
Holds component version number.

Type
AString value

Syntax
Basic

object.Version
The Version property syntax has these parts:
object

An expression evaluating to an object of type Keys.

Remarks
You can find here version number of your instance of wodKeys.dll component. Please, provide us with this information if you need help from our techsupport
department.

Platforms
Windows

wodKeys Keys Version

Page 34 of 37

wodKeys help - How to get support?

How to get support


Email addresses
general@weonlydo.com - general issues and questions
techsupport@weonlydo.com - technical support for all WeOnlyDo! components
sales@weonlydo.com - sales related issues
Online forum
http://www.weonlydo.com/index.asp?forum=1
Phone numbers
(NOTE: not to be used for technical support issues. Please use email instead.)
USA& Canada: +1 253 243 2486 (VOIP redirected)
International:+385 91 2500 950
Mailing address
WeOnlyDo! Software
Secure Plus d.o.o.
Ruzina 9
Osijek HR-31000
Croatia

Although we do not provide phone support, in case of urgency you can contact us at above phone numbers. Please take in consideration our time zone which is
GMT+1. Please do not phone call us for technical support issues. Use our forums or send us email - we will reply within 24 hours.

Platforms
Windows

wodKeys How to get support

Page 35 of 37

wodKeys help - Technical information

Technical information
Remarks
General
wodKeys is a COM object (wodKeys.dll), designed to be initialized dynamically from your code, and declared from within your code. It does not have user interface, it
is windowless. Usually, you will initialize it with

Dim Key1 as Keys

COM Object information


Filename

wodKeys.DLL

Class name

WeOnlyDo.Keys.1

Class ID

{D7BBDB40-8B0E-46D1-8D36-64828BA5564E}

Events class ID

none

Compatibility

VB 5.0 and above, VFP 5.0 and above

Built with

Microsoft Visual Studio 2008 C++, OpenSSL

Required DLLs

none

Documentation
Help filename

wodKeys.CHM

Distribution note
You are not allowed to distribute wodKeys.dll without accompanying product you have purchased from WeOnlyDo! Software. Please refer to distribution notes of that
product.

Platforms
Windows

wodKeys Technical information

Page 36 of 37

wodKeys help - Error list

Error list
Below is the list of errors that can be fired by the component.
Value

Description

30000

Password too short. It should be at least 4 bytes.

30001

Failed to create file on disk.

30002

Invalid key type.

30003

Failed to write key.

30004

Failed to generate new key.

30005

Failed to open key file.

30006

Failed to import key from file.

30007

Unknown key format.

30010

Keys not loaded or generated.

30011

Only public key is available.

30012

Failed to import key from XML data.

39999

License key missing. You can not use this component in design environment.

Platforms
Windows

wodKeys Error list

Page 37 of 37

You might also like