Quantcast
Channel: sshnet Discussions Rss Feed
Viewing all articles
Browse latest Browse all 1729

New Post: PrivateKeyAuthenticationMethod

$
0
0
The method takes a privateKeyFile. The PrivateKeyFile is overloaded and I'm looking at two choices. One takes just a Filename, the other takes a Filename and Passphrase.

In my program I'm allowing for a private key that does not use a passphrase. what I'm wondering is whether or not I can get by with just the second method and pass in an empty string for the passphrase when there is none?

In other words, I want to use the single constructor and hope it is smart enough to deal with a valid passphrase or an empty string. Was thinking of trying to pass null, like this:
PrivateKeyFile ppkFile = new PrivateKeyFile(@"C:\Utilities\mercury.ppk",null);
I may try to peruse the source code about this since I'm also unsure of how the PrivateKey method is utilizing the key and passphrase. It's unclear to me whether or not the target host is supposed to be receiving the ppk and passphrase separately and then does the decrypting itself, or if this is the job of the SSH client, decrypting on client machine before using in connection?

The docs don't have an example of this yet as far as I can tell.

I am also wondering if I can save the PPK text in my app and then just load that into a PrivateKeyFile. No overload seems to suggest that. I don't suppose I can substitute the string for System.IO.Stream argument. That would have been a nice fit for one of my use cases.

Viewing all articles
Browse latest Browse all 1729

Trending Articles



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