Class BytesIdentityInfo
java.lang.Object
org.apache.commons.vfs2.provider.sftp.BytesIdentityInfo
- All Implemented Interfaces:
IdentityProvider
Structure for an identity based on byte arrays.
- Since:
- 2.4
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final byte[]private final byte[]private final byte[] -
Constructor Summary
ConstructorsConstructorDescriptionBytesIdentityInfo(byte[] privateKey, byte[] passphrase) Constructs an identity info with private and passphrase for the private key.BytesIdentityInfo(byte[] privateKey, byte[] publicKey, byte[] passphrase) Constructs an identity info with private and public key and passphrase for the private key. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddIdentity(com.jcraft.jsch.JSch jsch) Add this identity to the given JSch.booleanbyte[]Gets the passphrase.byte[]Deprecated.byte[]Gets the private key.byte[]Gets the public key.inthashCode()
-
Field Details
-
passphrase
private final byte[] passphrase -
privateKey
private final byte[] privateKey -
publicKey
private final byte[] publicKey
-
-
Constructor Details
-
BytesIdentityInfo
public BytesIdentityInfo(byte[] privateKey, byte[] passphrase) Constructs an identity info with private and passphrase for the private key.- Parameters:
privateKey- Private key bytespassphrase- The passphrase to decrypt the private key (can benullif no passphrase is used)
-
BytesIdentityInfo
public BytesIdentityInfo(byte[] privateKey, byte[] publicKey, byte[] passphrase) Constructs an identity info with private and public key and passphrase for the private key.- Parameters:
privateKey- Private key bytespublicKey- The public key part used for connections with exchange of certificates (can benull)passphrase- The passphrase to decrypt the private key (can benullif no passphrase is used)
-
-
Method Details
-
addIdentity
public void addIdentity(com.jcraft.jsch.JSch jsch) throws com.jcraft.jsch.JSchException Description copied from interface:IdentityProviderAdd this identity to the given JSch.- Specified by:
addIdentityin interfaceIdentityProvider- Parameters:
jsch- Target JSch.- Throws:
com.jcraft.jsch.JSchException- If I/O error occurs.
-
equals
-
getPassphrase
public byte[] getPassphrase()Gets the passphrase.- Returns:
- the passphrase.
- Since:
- 2.10.0
-
getPassPhrase
Deprecated.UsegetPassphrase().Gets the passphrase.- Returns:
- the passphrase.
-
getPrivateKeyBytes
public byte[] getPrivateKeyBytes()Gets the private key.- Returns:
- the private key.
-
getPublicKeyBytes
public byte[] getPublicKeyBytes()Gets the public key.- Returns:
- the public key.
-
hashCode
public int hashCode()
-
getPassphrase().