Class BasicSSHUserPrivateKey
- java.lang.Object
-
- com.cloudbees.plugins.credentials.BaseCredentials
-
- com.cloudbees.plugins.credentials.impl.BaseStandardCredentials
-
- com.cloudbees.jenkins.plugins.sshcredentials.impl.BaseSSHUser
-
- com.cloudbees.jenkins.plugins.sshcredentials.impl.BasicSSHUserPrivateKey
-
- All Implemented Interfaces:
SSHUser
,SSHUserPrivateKey
,com.cloudbees.plugins.credentials.common.IdCredentials
,com.cloudbees.plugins.credentials.common.StandardCredentials
,com.cloudbees.plugins.credentials.common.StandardUsernameCredentials
,com.cloudbees.plugins.credentials.common.UsernameCredentials
,com.cloudbees.plugins.credentials.Credentials
,ExtensionPoint
,Describable<com.cloudbees.plugins.credentials.Credentials>
,Serializable
public class BasicSSHUserPrivateKey extends BaseSSHUser implements SSHUserPrivateKey
A simple username / password for use with SSH connections.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
BasicSSHUserPrivateKey.DescriptorImpl
static class
BasicSSHUserPrivateKey.DirectEntryPrivateKeySource
Let the user enter the key directly via copy & pastestatic class
BasicSSHUserPrivateKey.FileOnMasterPrivateKeySource
Deprecated.This approach has security vulnerability and should be migrated toBasicSSHUserPrivateKey.DirectEntryPrivateKeySource
static class
BasicSSHUserPrivateKey.PrivateKeySource
A source of private keysstatic class
BasicSSHUserPrivateKey.PrivateKeySourceDescriptor
Descriptor for aBasicSSHUserPrivateKey.PrivateKeySource
static class
BasicSSHUserPrivateKey.UsersPrivateKeySource
Deprecated.This approach has security vulnerability and should be migrated toBasicSSHUserPrivateKey.DirectEntryPrivateKeySource
-
Nested classes/interfaces inherited from class com.cloudbees.plugins.credentials.impl.BaseStandardCredentials
com.cloudbees.plugins.credentials.impl.BaseStandardCredentials.BaseStandardCredentialsDescriptor
-
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
Nested classes/interfaces inherited from interface com.cloudbees.plugins.credentials.common.IdCredentials
com.cloudbees.plugins.credentials.common.IdCredentials.Helpers
-
-
Field Summary
-
Fields inherited from class com.cloudbees.jenkins.plugins.sshcredentials.impl.BaseSSHUser
username
-
-
Constructor Summary
Constructors Constructor Description BasicSSHUserPrivateKey(com.cloudbees.plugins.credentials.CredentialsScope scope, String id, String username, BasicSSHUserPrivateKey.PrivateKeySource privateKeySource, String passphrase, String description)
Constructor for stapler.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Secret
getPassphrase()
Gets the passphrase for the private keys ornull
if the private keys are not protected by a passphase.List<String>
getPrivateKeys()
Returns a collection of keys to try in order for authentication.BasicSSHUserPrivateKey.PrivateKeySource
getPrivateKeySource()
protected Object
readResolve()
-
Methods inherited from class com.cloudbees.jenkins.plugins.sshcredentials.impl.BaseSSHUser
getUsername, isUsernameSecret, setUsernameSecret
-
Methods inherited from class com.cloudbees.plugins.credentials.impl.BaseStandardCredentials
equals, getDescription, getId, hashCode
-
Methods inherited from class com.cloudbees.plugins.credentials.BaseCredentials
getDescriptor, getScope
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.cloudbees.plugins.credentials.Credentials
forRun, getDescriptor, getScope
-
Methods inherited from interface com.cloudbees.jenkins.plugins.sshcredentials.SSHUserPrivateKey
getPrivateKey
-
-
-
-
Constructor Detail
-
BasicSSHUserPrivateKey
@DataBoundConstructor public BasicSSHUserPrivateKey(com.cloudbees.plugins.credentials.CredentialsScope scope, String id, String username, BasicSSHUserPrivateKey.PrivateKeySource privateKeySource, String passphrase, String description)
Constructor for stapler.- Parameters:
scope
- the credentials scopeusername
- the username.privateKeySource
- the private key.passphrase
- the password.description
- the description.
-
-
Method Detail
-
readResolve
protected Object readResolve()
- Overrides:
readResolve
in classBaseSSHUser
-
getPrivateKeys
@NonNull public List<String> getPrivateKeys()
Description copied from interface:SSHUserPrivateKey
Returns a collection of keys to try in order for authentication.- Specified by:
getPrivateKeys
in interfaceSSHUserPrivateKey
- Returns:
- a collection of keys to try in order for authentication.
- See Also:
SSHAuthenticator.getPrivateKeys(com.cloudbees.jenkins.plugins.sshcredentials.SSHUserPrivateKey)
-
getPrivateKeySource
@NonNull public BasicSSHUserPrivateKey.PrivateKeySource getPrivateKeySource()
-
getPassphrase
@CheckForNull public Secret getPassphrase()
Gets the passphrase for the private keys ornull
if the private keys are not protected by a passphase.- Specified by:
getPassphrase
in interfaceSSHUserPrivateKey
- Returns:
- the passphrase for the private keys or
null
if the private key are not protected by a passphase.
-
-