-
Notifications
You must be signed in to change notification settings - Fork 37
Open
Description
4.6中,由于安全性问题,这个方法会出现bug。
public static void SetPrivateKeyPath(string newPrivateKeyPath)
{
try
{
var privateKeyFile = new FileStream(newPrivateKeyPath, FileMode.Open);
PrivateKey = FormatPrivateKey((new StreamReader(privateKeyFile)).ReadToEnd());
privateKeyFile.Close();
}
catch (IOException ex)
{
throw new PingppException("Private key read error. " + ex);
}
}
请使用下面的安全方法:
public static void SetPrivateKeyPath(string newPrivateKeyPath)
{
try
{
var privateKeyFile = new FileStream(newPrivateKeyPath, FileMode.Open);
PrivateKey = FormatPrivateKey((new StreamReader(privateKeyFile)).ReadToEnd());
privateKeyFile.Close();
}
catch (IOException ex)
{
throw new PingppException("Private key read error. " + ex);
}
}
Metadata
Metadata
Assignees
Labels
No labels