SSH Client connection - WeOnlyDo Discussion board

SSH Client connection (wodSSHTunnel)

by Jasmine, Thursday, December 15, 2016, 21:12 (2660 days ago) @ Mariana Cimpoca

Hi Mariana,

this still doesn't help. What is CKeys? I don't recall we are providing 'CKeys' as a class. We provide COM object call Keys, which you somehow wrap in C++ class, but I'm not sure how exactly.

I don't see you ever intiialize it. Are you sure CKeys actually is an object, and it actually calls our methods?

If you can ZIP your sample project you created for testing wodKeys, I'll be happy to check it out.

I just tried our 'ConsoleApp' sample that comes with wodSSHTunnel, and it works without issues. Key is generated and saved.

Here's the code that does the work:

int main(int argc, char *argv[])
{
   IKeysPtr pKeys;

   HRESULT hr = NULL;
   CoInitialize (NULL);

   hr = pKeys.CreateInstance (CLSID_Keys, NULL);
   if (FAILED (hr))
   {
       _com_error comErr (hr);
       printf ("Unable to load wodKeys interface.\nErr #%u: %s", hr, comErr.ErrorMessage () );
       CoUninitialize ();
       return -1;
   }

   SSHKeyTypes ktype = (SSHKeyTypes)0; //RSAKey;

   VARIANT var;
   var.vt = VT_ERROR;
   pKeys->Generate(ktype, var);

   _bstr_t fname = "rsapriv.txt";
   pKeys->Save(ktype, fname, var);


   pKeys.Release();
   CoUninitialize ();


   return 0;
}

I hope this helps!
Jasmine


Complete thread: