Skip to content

Commit 526707f

Browse files
committed
Add Comment Property to Key
1 parent 080a268 commit 526707f

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
@@ -524,8 +524,7 @@ private Key ParseOpenSshV1Key(byte[] keyFileData, string passPhrase)
524524
throw new SshException("OpenSSH key type '" + keyType + "' is not supported.");
525525
}
526526

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

530529
//The list of privatekey/comment pairs is padded with the bytes 1, 2, 3, ...
531530
//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)