Package com.jcraft.jsch
Class IdentityFile
java.lang.Object
com.jcraft.jsch.IdentityFile
- All Implemented Interfaces:
Identity
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Disposes internally allocated data, like byte array for the private key.booleandecrypt()Deprecated.This method should not be invoked.Returns the name of the key algorithm.getName()Returns the name of this identity.byte[]Returns the public-key blob.byte[]getSignature(byte[] data) Signs on data with this identity, and returns the result.booleanReturns true if this identity is cyphered.(package private) static IdentityFilenewInstance(String name, byte[] prvkey, byte[] pubkey, JSch jsch) (package private) static IdentityFilenewInstance(String prvfile, String pubfile, JSch jsch) booleansetPassphrase(byte[] passphrase) Decrypts this identity with the specified pass-phrase.
-
Field Details
-
jsch
-
kpair
-
identity
-
-
Constructor Details
-
IdentityFile
- Throws:
JSchException
-
-
Method Details
-
newInstance
- Throws:
JSchException
-
newInstance
static IdentityFile newInstance(String name, byte[] prvkey, byte[] pubkey, JSch jsch) throws JSchException - Throws:
JSchException
-
setPassphrase
Decrypts this identity with the specified pass-phrase.- Specified by:
setPassphrasein interfaceIdentity- Parameters:
passphrase- the pass-phrase for this identity.- Returns:
- true if the decryption is succeeded or this identity is not cyphered.
- Throws:
JSchException
-
getPublicKeyBlob
public byte[] getPublicKeyBlob()Returns the public-key blob.- Specified by:
getPublicKeyBlobin interfaceIdentity- Returns:
- the public-key blob
-
getSignature
public byte[] getSignature(byte[] data) Signs on data with this identity, and returns the result.- Specified by:
getSignaturein interfaceIdentity- Parameters:
data- data to be signed- Returns:
- the signature
-
decrypt
public boolean decrypt()Deprecated.This method should not be invoked. -
getAlgName
Returns the name of the key algorithm.- Specified by:
getAlgNamein interfaceIdentity- Returns:
- "ssh-rsa" or "ssh-dss"
-
getName
Returns the name of this identity. It will be useful to identify this object in theIdentityRepository. -
isEncrypted
public boolean isEncrypted()Returns true if this identity is cyphered.- Specified by:
isEncryptedin interfaceIdentity- Returns:
- true if this identity is cyphered.
-
clear
public void clear()Disposes internally allocated data, like byte array for the private key. -
getKeyPair
-