Re: Read private key from string (not file)
@AKG: No
If this works:
Then this does the same:
@
prefixing. No hex encoding. That's needed in scripting only. In .NET assembly, just pass the contents of your key file to SessionOptions.SshPrivateKey
as it is, as @randallg has shown. No special encoding.
If this works:
sessionOptions.SshPrivateKeyPath = @"C:\path\key.ppk"
Then this does the same:
sessionOptions.SshPrivateKey = File.ReadAllText(@"C:\path\key.ppk")