public ISshKey DeserializeFile(string fileName)
{
using (FileStream stream =
new FileStream(fileName, FileMode.Open, FileAccess.Read)) {
var key = Deserialize(stream) as ISshKey;
if (string.IsNullOrEmpty(key.Comment)) {
try {
var pubFile = fileName + ".pub";
if (File.Exists(pubFile)) {
var lines = File.ReadAllLines(pubFile, Encoding.UTF8);
key.Comment = GetComment (lines);
}
} catch (Exception) {
// don't worry about it
}
}
key.Source = fileName;
return key;
}
}