Back to product page
- Introduction
- Overview
- License agreement
- Getting Started
- Objects
- Enumerations
- wodSSHD
- Methods
- Properties
- Events
- Connecting
- CryptoInformation
- Disconnected
- LoginGSSAPI
- LoginPassword
- LoginPubkey
- PortBindRequest
- PortForwardConnect
- PortForwardDisconnect
- PortForwardRequest
- Received
- ServiceRequest
- ServiceStart
- SftpDeleteFile
- SftpDownloadFile
- SftpFileTransferData
- SftpListDir
- SftpListDirData
- SftpMakeDir
- SftpProgress
- SftpRemoveDir
- SftpRename
- SftpTransferComplete
- SftpUploadFile
- StateChanged
- IwodSSHDNotify
- Methods
- Connecting
- CryptoInformation
- Disconnected
- LoginGSSAPI
- LoginPassword
- LoginPubkey
- PortBindRequest
- PortForwardConnect
- PortForwardDisconnect
- PortForwardRequest
- Received
- ServiceRequest
- ServiceStart
- SftpDeleteFile
- SftpDownloadFile
- SftpFileTransferData
- SftpListDir
- SftpListDirData
- SftpMakeDir
- SftpProgress
- SftpRemoveDir
- SftpRename
- SftpTransferComplete
- SftpUploadFile
- StateChanged
- Methods
- SSHKeyPair
- SSHUser
- SSHUsers
- How to get support
- Technical information
- Fast notifications
- Error list
Keys property
Holds information about private and public keys.
Type
A SSHServiceTypesSSHKeyPair objectSyntax
- Basic
object.Keys
The Keys(object) syntax has these parts:
The Keys(object) syntax has these parts:
object | An expression evaluating to an object of type wodSSHD. |
Remarks
Since SSH protocol specification defines that server should have (unique) key (public and private pair) that is sent to the client and is used to encrypt communication, wodSSHD has one internal object that deals with the keys. This property holds a reference to such object.There is only one key necessary to have the server properly running - either RSA type key, or DSA. RSA is defined as a standard, and by specification all clients should support it. Before server is started, you should make sure you have properly generated new pair of keys (or loaded old one using provided functions). However, to allow more clients to access you server you should generate both RSA and DSA keys.
Important thing is to try to keep the same key as long as you can (or need to). Since clients that connect always check if key you're using is the same one last time was used (this way they know whether they connected to the same server), changing it often can produce problems to the clients. Also, when client connects for the first time and wants to make sure it connected to the server he intended to, he can check Fingerprint information he got with the one you will provide him through Fingerprint property.
Creating new keys is really easy. This little code snippet can be used in your projects so you can be sure there's always proper key is loaded.
Private Sub Form_Load()
Dim Filename As String
Dim Password As String
' initialize wodSSHD
Set wodSSHD1 = New wodSSHDCom
' first we need to load or generate key we will use
' in productional systems, generate both keys (RSA/DSA)
' here, 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 to do so in real life
Password = "My secret password"
' try to load the key
wodSSHD1.Keys.Load Filename, Password
If Err <> 0 Then
' load failed - we will generate new one
wodSSHD1.Keys.Generate RSAkey
' and save it for the future
wodSSHD1.Keys.Save RSAkey, Filename, Password
End If
' now the server can be started...
End Sub