Package hudson.cli
Class PrivateKeyProvider
java.lang.Object
hudson.cli.PrivateKeyProvider
Read DSA or RSA key from file(s) asking for password interactively.
- Since:
- 1.556
- Author:
- ogondza
-
Constructor Details
-
PrivateKeyProvider
public PrivateKeyProvider()
-
-
Method Details
-
getKeys
Get keys read so far.- Returns:
- Possibly empty list. Never null.
-
hasKeys
public boolean hasKeys() -
readFromDefaultLocations
public boolean readFromDefaultLocations()Read keys from default keyFiles.ssh/id_rsa,.ssh/id_dsaand.ssh/identity.- Returns:
- true if some key was read successfully.
-
readFrom
Read key from keyFile.- Throws:
IOExceptionGeneralSecurityException
-
loadKey
- Throws:
IOExceptionGeneralSecurityException
-
loadKey
public static KeyPair loadKey(String pemString, String passwd) throws IOException, GeneralSecurityException - Throws:
IOExceptionGeneralSecurityException
-