Package io.jenkins.blueocean.ssh
Class SSHKeyUtils
java.lang.Object
io.jenkins.blueocean.ssh.SSHKeyUtils
Utilities to generate a private key and perform necessary conversions
on it
- Author:
- kzantow
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic byte[]
Encodes the public key according to some spec somewherestatic String
generateKey
(int keySize) Generates a new SSH private key with specified keySizestatic String
getPublicKey
(String privateKey, String comment) Gets the public key, with a comment for the given private key
-
Constructor Details
-
SSHKeyUtils
public SSHKeyUtils()
-
-
Method Details
-
generateKey
Generates a new SSH private key with specified keySize- Parameters:
keySize
- size to use for the key- Returns:
- a SSH private key
-
getPublicKey
Gets the public key, with a comment for the given private key- Parameters:
privateKey
- SSH private key to usecomment
- comment with the key- Returns:
- SSH public key
-
encodePublicKey
Encodes the public key according to some spec somewhere- Parameters:
key
- public key to use- Returns:
- the ssh-rsa bytes
-