|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.jcraft.jsch.KeyPair
public abstract class KeyPair
| Field Summary | |
|---|---|
protected byte[] |
data
|
static int |
DSA
|
static int |
ECDSA
|
protected boolean |
encrypted
|
static int |
ERROR
|
protected String |
publicKeyComment
|
static int |
RSA
|
static int |
UNKNOWN
|
| Constructor Summary | |
|---|---|
KeyPair(JSch jsch)
|
|
| Method Summary | |
|---|---|
boolean |
decrypt(byte[] _passphrase)
|
boolean |
decrypt(String _passphrase)
|
void |
dispose()
|
void |
finalize()
|
abstract byte[] |
forSSHAgent()
|
static KeyPair |
genKeyPair(JSch jsch,
int type)
|
static KeyPair |
genKeyPair(JSch jsch,
int type,
int key_size)
|
String |
getFingerPrint()
Returns the finger-print of the public key. |
abstract int |
getKeyType()
|
byte[] |
getPublicKeyBlob()
Returns the blob of the public key. |
String |
getPublicKeyComment()
|
abstract byte[] |
getSignature(byte[] data)
|
abstract Signature |
getVerifier()
|
boolean |
isEncrypted()
|
static KeyPair |
load(JSch jsch,
byte[] prvkey,
byte[] pubkey)
|
static KeyPair |
load(JSch jsch,
String prvkey)
|
static KeyPair |
load(JSch jsch,
String prvfile,
String pubfile)
|
void |
setPassphrase(byte[] passphrase)
Deprecated. use #writePrivateKey(String name, byte[] passphrase) |
void |
setPassphrase(String passphrase)
Deprecated. use #writePrivateKey(java.io.OutputStream out, byte[] passphrase) |
void |
setPublicKeyComment(String publicKeyComment)
|
void |
writePrivateKey(OutputStream out)
Writes the plain private key to the given output stream. |
void |
writePrivateKey(OutputStream out,
byte[] passphrase)
Writes the cyphered private key to the given output stream. |
void |
writePrivateKey(String name)
Writes the plain private key to the file. |
void |
writePrivateKey(String name,
byte[] passphrase)
Writes the cyphered private key to the file. |
void |
writePublicKey(OutputStream out,
String comment)
Writes the public key with the specified comment to the output stream. |
void |
writePublicKey(String name,
String comment)
Writes the public key with the specified comment to the file. |
void |
writeSECSHPublicKey(OutputStream out,
String comment)
Writes the public key with the specified comment to the output stream in the format defined in http://www.ietf.org/rfc/rfc4716.txt |
void |
writeSECSHPublicKey(String name,
String comment)
Writes the public key with the specified comment to the output stream in the format defined in http://www.ietf.org/rfc/rfc4716.txt |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int ERROR
public static final int DSA
public static final int RSA
public static final int ECDSA
public static final int UNKNOWN
protected String publicKeyComment
protected boolean encrypted
protected byte[] data
| Constructor Detail |
|---|
public KeyPair(JSch jsch)
| Method Detail |
|---|
public static KeyPair genKeyPair(JSch jsch,
int type)
throws JSchException
JSchException
public static KeyPair genKeyPair(JSch jsch,
int type,
int key_size)
throws JSchException
JSchExceptionpublic abstract byte[] getSignature(byte[] data)
public abstract Signature getVerifier()
public abstract byte[] forSSHAgent()
throws JSchException
JSchExceptionpublic String getPublicKeyComment()
public void setPublicKeyComment(String publicKeyComment)
public void writePrivateKey(OutputStream out)
out - output streamwritePrivateKey(java.io.OutputStream out, byte[] passphrase)
public void writePrivateKey(OutputStream out,
byte[] passphrase)
out - output streampassphrase - a passphrase to encrypt the private keypublic abstract int getKeyType()
public byte[] getPublicKeyBlob()
public void writePublicKey(OutputStream out,
String comment)
out - output streamcomment - comment
public void writePublicKey(String name,
String comment)
throws FileNotFoundException,
IOException
name - file namecomment - comment
FileNotFoundException
IOExceptionwritePublicKey(java.io.OutputStream out, String comment)
public void writeSECSHPublicKey(OutputStream out,
String comment)
out - output streamcomment - comment
public void writeSECSHPublicKey(String name,
String comment)
throws FileNotFoundException,
IOException
name - file namecomment - comment
FileNotFoundException
IOExceptionwriteSECSHPublicKey(java.io.OutputStream out, String comment)
public void writePrivateKey(String name)
throws FileNotFoundException,
IOException
name - file name
FileNotFoundException
IOExceptionwritePrivateKey(String name, byte[] passphrase)
public void writePrivateKey(String name,
byte[] passphrase)
throws FileNotFoundException,
IOException
name - file namepassphrase - a passphrase to encrypt the private key
FileNotFoundException
IOExceptionwritePrivateKey(java.io.OutputStream out, byte[] passphrase)public String getFingerPrint()
public void setPassphrase(String passphrase)
public void setPassphrase(byte[] passphrase)
public boolean isEncrypted()
public boolean decrypt(String _passphrase)
public boolean decrypt(byte[] _passphrase)
public static KeyPair load(JSch jsch,
String prvkey)
throws JSchException
JSchException
public static KeyPair load(JSch jsch,
String prvfile,
String pubfile)
throws JSchException
JSchException
public static KeyPair load(JSch jsch,
byte[] prvkey,
byte[] pubkey)
throws JSchException
JSchExceptionpublic void dispose()
public void finalize()
finalize in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||