com.jcraft.jsch

Class KeyPair

Known Direct Subclasses:
KeyPairDSA, KeyPairRSA

public abstract class KeyPair
extends java.lang.Object

Field Summary

static int
DSA
static int
ERROR
static int
RSA
static int
UNKNOWN

Constructor Summary

KeyPair(JSch jsch)

Method Summary

boolean
decrypt(String _passphrase)
void
dispose()
static KeyPair
genKeyPair(JSch jsch, int type)
static KeyPair
genKeyPair(JSch jsch, int type, int key_size)
String
getFingerPrint()
int
getKeyType()
byte[]
getPublicKeyBlob()
boolean
isEncrypted()
static KeyPair
load(JSch jsch, String prvkey)
static KeyPair
load(JSch jsch, String prvkey, String pubkey)
void
setPassphrase(String passphrase)
void
setPassphrase(byte[] passphrase)
void
writePrivateKey(String name)
void
writePrivateKey(java.io.OutputStream out)
void
writePublicKey(String name, String comment)
void
writePublicKey(java.io.OutputStream out, String comment)
void
writeSECSHPublicKey(String name, String comment)
void
writeSECSHPublicKey(java.io.OutputStream out, String comment)

Field Details

DSA

public static final int DSA

Field Value:
1


ERROR

public static final int ERROR

Field Value:
0


RSA

public static final int RSA

Field Value:
2


UNKNOWN

public static final int UNKNOWN

Field Value:
3

Constructor Details

KeyPair

public KeyPair(JSch jsch)

Method Details

decrypt

public boolean decrypt(String _passphrase)


dispose

public void dispose()


genKeyPair

public static KeyPair genKeyPair(JSch jsch,
                                 int type)
            throws JSchException


genKeyPair

public static KeyPair genKeyPair(JSch jsch,
                                 int type,
                                 int key_size)
            throws JSchException


getFingerPrint

public String getFingerPrint()


getKeyType

public int getKeyType()


getPublicKeyBlob

public byte[] getPublicKeyBlob()


isEncrypted

public boolean isEncrypted()


load

public static KeyPair load(JSch jsch,
                           String prvkey)
            throws JSchException


load

public static KeyPair load(JSch jsch,
                           String prvkey,
                           String pubkey)
            throws JSchException


setPassphrase

public void setPassphrase(String passphrase)


setPassphrase

public void setPassphrase(byte[] passphrase)


writePrivateKey

public void writePrivateKey(String name)
            throws java.io.FileNotFoundException,
                   java.io.IOException


writePrivateKey

public void writePrivateKey(java.io.OutputStream out)


writePublicKey

public void writePublicKey(String name,
                           String comment)
            throws java.io.FileNotFoundException,
                   java.io.IOException


writePublicKey

public void writePublicKey(java.io.OutputStream out,
                           String comment)


writeSECSHPublicKey

public void writeSECSHPublicKey(String name,
                                String comment)
            throws java.io.FileNotFoundException,
                   java.io.IOException


writeSECSHPublicKey

public void writeSECSHPublicKey(java.io.OutputStream out,
                                String comment)