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) |
byte[] |
getPassPhrase()
Get the passphrase of the private key.
|
File |
getPrivateKey()
Get the file with the private key.
|
File |
getPublicKey()
Get the file with the public key.
|
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
addIdentity
in interface IdentityProvider
com.jcraft.jsch.JSchException
public byte[] getPassPhrase()
public File getPrivateKey()
public File getPublicKey()
Copyright © 2002–2020 The Apache Software Foundation. All rights reserved.