EldoS | Feel safer!

Software components for data protection, secure storage and transfer

Error on client.keystorage=keystorage

Also by EldoS: MsgConnect
Cross-platform protocol-independent communication framework for building peer-to-peer and client-server applications and middleware components.
Posted: 08/21/2012 12:04:06
by gwinetworks gwinetworks (Standard support level)
Joined: 12/27/2011
Posts: 3

Hello all,

I am wondering if someone might shed some light on this. It works fine in the vb.net sample simple ssh client, but in my asp.net app, I get this error.

at the point of

KeyStorage = New TElSSHMemoryKeyStorage
client.KeyStorage = New TElSSHMemoryKeyStorage

I get Object reference not set to an instance of an object.

My code to this point is the same as it is in the sample.

Running this on Windows 7 IIS7. I also noticed that the assemblies are not added to the GAC during installation of the secureblackbox package.
Posted: 08/21/2012 15:13:24
by gwinetworks gwinetworks (Standard support level)
Joined: 12/27/2011
Posts: 3

For some reason, when I run this in a class, it works, but when I build it into a DLL and add a reference to it, I get the error? Any thoughts? Code is exactly the same

Imports System
Imports System.Net
Imports System.Net.Sockets
Imports SBUtils
Imports SBSharedResource
Imports SBSSHCommon
Imports SBSSHKeyStorage
Imports SBSSHConstants
Imports SBSSHClient
Imports SBSimpleSSH
Public Class Netconf
    Public WithEvents Client As New TElSimpleSSHClient
    Private Connected As Boolean
    Private ChangeComplete As Boolean = False
    Private KeyStorage As TElSSHMemoryKeyStorage
    Private recvBuffer(0) As Byte
    Private recvBufferIndex As Integer
    Private spoolBuffer(0) As Byte
    Private spoolBufferIndex As Integer
    Private lck As TElSharedResource

    Private Const sbbkey As String = "MYKEY"
    Private objErrorHandler As NCErrorHandler

    Private Sub Initialize()
        ReDim recvBuffer(65536)
        recvBufferIndex = 0
        ReDim spoolBuffer(65536)
        spoolBufferIndex = 0
        lck = New TElSharedResource
        Connected = False

        KeyStorage = New TElSSHMemoryKeyStorage
        client.KeyStorage = KeyStorage <-- Error here

    End Sub

Do I need to declare it differently when in a .dll file?
Posted: 08/22/2012 14:20:54
by gwinetworks gwinetworks (Standard support level)
Joined: 12/27/2011
Posts: 3

Forgot to use the New when declaring the client. brain fart moment I guess



Topic viewed 864 times

Number of guests: 1, registered members: 0, in total hidden: 0


Back to top

As of July 15, 2016 EldoS business operates as a division of /n software, inc. For more information, please read the announcement.

Got it!