public class IdentityInfo extends java.lang.Object implements IdentityProvider
Modifier and Type | Field and Description |
---|---|
private byte[] |
passPhrase |
private java.io.File |
privateKey |
private java.io.File |
publicKey |
Constructor and Description |
---|
IdentityInfo(java.io.File privateKey)
Constructs an identity info with private key.
|
IdentityInfo(java.io.File privateKey,
byte[] passPhrase)
Constructs an identity info with private key and its passphrase.
|
IdentityInfo(java.io.File privateKey,
java.io.File publicKey,
byte[] passPhrase)
Constructs an identity info with private and public key and passphrase for the private key.
|
Modifier and Type | Method and Description |
---|---|
void |
addIdentity(com.jcraft.jsch.JSch jsch) |
private java.lang.String |
getAbsolutePath(java.io.File file) |
byte[] |
getPassPhrase()
Get the passphrase of the private key.
|
java.io.File |
getPrivateKey()
Get the file with the private key.
|
java.io.File |
getPublicKey()
Get the file with the public key.
|
private final byte[] passPhrase
private final java.io.File privateKey
private final java.io.File publicKey
public IdentityInfo(java.io.File privateKey)
The key is not passphrase protected.
We use java.io.File because JSch cannot deal with VFS FileObjects.
privateKey
- The file with the private keypublic IdentityInfo(java.io.File privateKey, byte[] passPhrase)
We use java.io.File because JSch cannot deal with VFS FileObjects.
privateKey
- The file with the private keypassPhrase
- The passphrase to decrypt the private key (can be null
if no passphrase is used)public IdentityInfo(java.io.File privateKey, java.io.File publicKey, byte[] passPhrase)
We use java.io.File because JSch cannot deal with VFS FileObjects.
privateKey
- The file with the private keypublicKey
- The public key part used for connections with exchange of certificates (can be null
)passPhrase
- The passphrase to decrypt the private key (can be null
if no passphrase is used)public void addIdentity(com.jcraft.jsch.JSch jsch) throws com.jcraft.jsch.JSchException
addIdentity
in interface IdentityProvider
com.jcraft.jsch.JSchException
private java.lang.String getAbsolutePath(java.io.File file)
public byte[] getPassPhrase()
public java.io.File getPrivateKey()
public java.io.File getPublicKey()