Package jenkins.plugins.jclouds.internal
Class SSHPublicKeyExtractor
java.lang.Object
jenkins.plugins.jclouds.internal.SSHPublicKeyExtractor
Extracts a SSH public key from a SSH private key.
- Author:
- Fritz Elfert
-
Constructor Summary
-
Method Summary
-
Constructor Details
-
SSHPublicKeyExtractor
public SSHPublicKeyExtractor()
-
-
Method Details
-
extract
Extracts a SSH public key from a PEM-encoded SSH private key.- Parameters:
pem
- The PEM-encoded string (either RSA or DSA).passPhrase
- The passphrase to decrypt the private key (may be null, if the key is not encrypted).- Returns:
- A public key string in the form "<pubkey-type> <pubkey-base64>"
- Throws:
IOException
- if pem could not be decoded properly.
-