Quantcast
Channel: sshnet Issue Tracker Rss Feed
Viewing all articles
Browse latest Browse all 1026

Created Unassigned: Can't build Arrays of Keys or AuthMethods by calling DLL [2699]

$
0
0
<long winded explanation>
I am using LabVIEW and was pointed to this library as a possible solution to key based ssh for tunnels and interactive shells.
The library seems amazing in terms of scope, coding and ease of use. I can see constructors, properties and methods if I compile the source with COM interop enabled which is the good news.
The bad news for me is that I can't build the arrays required for AuthMethods or PrivateKeyFiles when connecting. The array constructor in mscorlib is not public and there seems to be no way for me to construct the required arrays by calling into the dll (private scope, abstract or some other reason??).
The good news for me is I have been able to add a couple of methods that enable me to accomplish this so I am happy.
The other bad news is that my methods are probably pretty horrible in terms of what really should be done.
Disclaimer: I am not a programmer and don't know C#
Also I hope I am posting this in the right place.
</long winded explanation>

Is there any interest in enabling external calls into the library from things like LabVIEW? If so that would be great.

What I put in that seems to work for me (except I haven't tested the append methods at all, they are just my best guess).

Added to PrivateKeyFile.cs

public PrivateKeyFile[] ArrayOfKeys(PrivateKeyFile Key1)
{
PrivateKeyFile[] keyFiles = new PrivateKeyFile[] { Key1 };
return keyFiles ;
}

public PrivateKeyFile[] ArrayOfKeysAppend(PrivateKeyFile AddKey, params PrivateKeyFile[] KeyFiles)
{
KeyFiles[KeyFiles.Length] = AddKey;
return KeyFiles;
}




Added to AuthenticationMethod.cs

public AuthenticationMethod[] ArrayOfAuthMethods(AuthenticationMethod Auth1)
{
AuthenticationMethod[] keyFiles = new AuthenticationMethod[] { Auth1 };
return keyFiles;
}

public AuthenticationMethod[] ArrayOfAuthMethodsAppend(AuthenticationMethod AddAuth, params AuthenticationMethod[] AuthMethods)
{
AuthMethods[AuthMethods.Length] = AddAuth;
return AuthMethods;
}

Many thanks

David

Viewing all articles
Browse latest Browse all 1026

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>