public class IdentityInfo extends Object implements IdentityProvider
| Constructor and Description |
|---|
IdentityInfo(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.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addIdentity(com.jcraft.jsch.JSch jsch)
Add this identity to the given JSch.
|
boolean |
equals(Object obj) |
byte[] |
getPassphrase()
Gets the passphrase of the private key.
|
byte[] |
getPassPhrase()
Deprecated.
Use
getPassphrase(). |
File |
getPrivateKey()
Gets the file with the private key.
|
File |
getPublicKey()
Gets the file with the public key.
|
int |
hashCode() |
public IdentityInfo(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(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(File privateKey, 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
IdentityProvideraddIdentity in interface IdentityProviderjsch - Target JSch.com.jcraft.jsch.JSchException - If I/O error occurs.public byte[] getPassphrase()
@Deprecated public byte[] getPassPhrase()
getPassphrase().public File getPrivateKey()
public File getPublicKey()
Copyright © 2002–2025 The Apache Software Foundation. All rights reserved.