Skip to content

Commit

Permalink
Merge pull request #259 from Alex-Vol-Amz/enhance-KeyPair-with-getSsh…
Browse files Browse the repository at this point in the history
…Name

Enhancement to present KeyPair.getKeyTypeString() method
  • Loading branch information
mwiede authored Jan 3, 2023
2 parents bb09e96 + 4b94250 commit a907690
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/main/java/com/jcraft/jsch/KeyPair.java
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,15 @@ public void writePrivateKey(OutputStream out, byte[] passphrase){
abstract byte[] getKeyTypeName();
public abstract int getKeyType();

/**
* Wrapper to provide the String representation of {@code #getKeyTypeName()}.
*
* @return the standard SSH key type string
*/
public String getKeyTypeString() {
return Util.byte2str(getKeyTypeName());
}

/**
* Returns the blob of the public key.
* @return blob of the public key
Expand Down

0 comments on commit a907690

Please sign in to comment.