Skip to content

Commit 33d9208

Browse files
committed
Add Comment Property to Key
1 parent 048a02c commit 33d9208

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/Renci.SshNet/PrivateKeyFile.cs

+1-2
Original file line numberDiff line numberDiff line change
@@ -515,8 +515,7 @@ private Key ParseOpenSshV1Key(byte[] keyFileData, string passPhrase)
515515
throw new SshException("OpenSSH key type '" + keyType + "' is not supported.");
516516
}
517517

518-
//comment, we don't need this but we could log it, not sure if necessary
519-
var comment = privateKeyReader.ReadString(Encoding.UTF8);
518+
parsedKey.Comment = privateKeyReader.ReadString(Encoding.UTF8);
520519

521520
//The list of privatekey/comment pairs is padded with the bytes 1, 2, 3, ...
522521
//until the total length is a multiple of the cipher block size.

src/Renci.SshNet/Security/Cryptography/Key.cs

+5
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,11 @@ public abstract class Key
3636
/// </value>
3737
public abstract int KeyLength { get; }
3838

39+
/// <summary>
40+
/// Gets the Key Comment
41+
/// </summary>
42+
public string Comment { get; set; }
43+
3944
/// <summary>
4045
/// Initializes a new instance of the <see cref="Key"/> class.
4146
/// </summary>

0 commit comments

Comments
 (0)