You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The documentation says "BEGIN ENCRYPTED PRIVATE KEY" is supported private key format. But when I use the following key the exception "Key 'ENCRYPTED' is not supported." is thrown.
When looking at the source code of "PrivateKeyFile.cs" it also looks like this simply is not supported:
private void Open(Stream privateKey, string passPhrase)
{
if (privateKey is null)
{
throw new ArgumentNullException(nameof(privateKey));
}
Match privateKeyMatch;
using (var sr = new StreamReader(privateKey))
{
var text = sr.ReadToEnd();
privateKeyMatch = PrivateKeyRegex.Match(text);
}
if (!privateKeyMatch.Success)
{
throw new SshException("Invalid private key file.");
}
var keyName = privateKeyMatch.Result("${keyName}");
var cipherName = privateKeyMatch.Result("${cipherName}");
var salt = privateKeyMatch.Result("${salt}");
var data = privateKeyMatch.Result("${data}");
...
switch (keyName)
{
case "RSA":
...
break;
case "DSA":
...
break;
case "EC":
..
break;
case "OPENSSH":
...
break;
case "SSH2 ENCRYPTED":
...
break;
default:
throw new NotSupportedException(string.Format(CultureInfo.CurrentCulture, "Key '{0}' is not supported.", keyName));
}
}
First of all the variable keyName will contain "ENCRYPTED" and there is no case for that in the switch statement. So it wil throw the mentioned exception. Also if it was going to match with "RSA" the passPhrase would not be used?
So either the regex is wrong and extracts the wrong values or the implementation is simply missing and not true according to the documentation.
I'm using the version "2024.1.0" btw.
The text was updated successfully, but these errors were encountered:
Hi, it is supported on the current develop branch and in the next imminent release. You can try it out from the CI feed at https://ci.appveyor.com/nuget/ssh-net e.g. version 2024.2.0-prerelease.1
The documentation says "BEGIN ENCRYPTED PRIVATE KEY" is supported private key format. But when I use the following key the exception "Key 'ENCRYPTED' is not supported." is thrown.
When looking at the source code of "PrivateKeyFile.cs" it also looks like this simply is not supported:
First of all the variable keyName will contain "ENCRYPTED" and there is no case for that in the switch statement. So it wil throw the mentioned exception. Also if it was going to match with "RSA" the passPhrase would not be used?
So either the regex is wrong and extracts the wrong values or the implementation is simply missing and not true according to the documentation.
I'm using the version "2024.1.0" btw.
The text was updated successfully, but these errors were encountered: