Class IdentityInfo
java.lang.Object
org.apache.commons.vfs2.provider.sftp.IdentityInfo
- All Implemented Interfaces:
IdentityProvider
Structure for an identity based on Files.
- Since:
- 2.1
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionIdentityInfo
(File privateKey) Constructs an identity info with private key.IdentityInfo
(File privateKey, byte[] passPhrase) Constructs an identity info with private key and its passphrase.IdentityInfo
(File privateKey, File publicKey, byte[] passPhrase) Constructs an identity info with private and public key and passphrase for the private key. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addIdentity
(com.jcraft.jsch.JSch jsch) private String
getAbsolutePath
(File file) byte[]
Get the passphrase of the private key.Get the file with the private key.Get the file with the public key.
-
Field Details
-
passPhrase
private final byte[] passPhrase -
privateKey
-
publicKey
-
-
Constructor Details
-
IdentityInfo
Constructs an identity info with private key.The key is not passphrase protected.
We use java.io.File because JSch cannot deal with VFS FileObjects.
- Parameters:
privateKey
- The file with the private key- Since:
- 2.1
-
IdentityInfo
Constructs an identity info with private key and its passphrase.We use java.io.File because JSch cannot deal with VFS FileObjects.
- Parameters:
privateKey
- The file with the private keypassPhrase
- The passphrase to decrypt the private key (can benull
if no passphrase is used)- Since:
- 2.1
-
IdentityInfo
Constructs an identity info with private and public key and passphrase for the private key.We use java.io.File because JSch cannot deal with VFS FileObjects.
- Parameters:
privateKey
- The file with the private keypublicKey
- The public key part used for connections with exchange of certificates (can benull
)passPhrase
- The passphrase to decrypt the private key (can benull
if no passphrase is used)- Since:
- 2.1
-
-
Method Details
-
addIdentity
public void addIdentity(com.jcraft.jsch.JSch jsch) throws com.jcraft.jsch.JSchException - Specified by:
addIdentity
in interfaceIdentityProvider
- Throws:
com.jcraft.jsch.JSchException
- Since:
- 2.4
-
getAbsolutePath
-
getPassPhrase
public byte[] getPassPhrase()Get the passphrase of the private key.- Returns:
- the passphrase
- Since:
- 2.1
-
getPrivateKey
Get the file with the private key.- Returns:
- the file
- Since:
- 2.1
-
getPublicKey
Get the file with the public key.- Returns:
- the file
- Since:
- 2.1
-