Base class for a pair of public and private key. More...
Public Member Functions | |
String | getPublicKeyComment () |
Static Public Member Functions | |
static KeyPair | genKeyPair (JSch jsch, int type) throws JSchException |
Creates a new key pair with default key size of 1024 bits. | |
static KeyPair | genKeyPair (JSch jsch, int type, int key_size) throws JSchException |
Creates a new key pair. | |
Static Public Attributes | |
static final int | ERROR = 0 |
Key type constant: some error occured, or the keypair was not initialized. | |
static final int | DSA = 1 |
Key type constant: DSA. | |
static final int | RSA = 2 |
Key type constant: RSA. | |
static final int | UNKNOWN = 3 |
Key type constant: unknown key type. | |
Package Functions | |
abstract void | generate (int key_size) throws JSchException |
abstract byte[] | getBegin () |
abstract byte[] | getEnd () |
abstract int | getKeySize () |
Package Attributes | |
int | vendor = VENDOR_OPENSSH |
JSch | jsch = null |
Static Package Attributes | |
static final int | VENDOR_OPENSSH = 0 |
static final int | VENDOR_FSECURE = 1 |
Private Attributes | |
String | publicKeyComment = "" |
Cipher | cipher |
HASH | hash |
Random | random |
byte[] | passphrase |
Static Private Attributes | |
static final byte[] | cr = Util.str2byte("\n") |
Base class for a pair of public and private key.
This class is used internally by the library and not necessary for normal use by the application.
An application may use this class to generate new keys with genKeyPair, and then write the KeyPair to files, which then might be used with JSch.addIdentity.
Another possible use would be to load load} a key pair in order to change the passphrase.
Definition at line 51 of file KeyPair.java.
abstract void com.jcraft.jsch.KeyPair.generate | ( | int | key_size | ) | throws JSchException [package, pure virtual] |
Implemented in com.jcraft.jsch.KeyPairDSA, and com.jcraft.jsch.KeyPairRSA.
Referenced by com.jcraft.jsch.KeyPair.genKeyPair().
static KeyPair com.jcraft.jsch.KeyPair.genKeyPair | ( | JSch | jsch, | |
int | type, | |||
int | key_size | |||
) | throws JSchException [static] |
Creates a new key pair.
jsch | the JSch object used for configuration purposes. | |
type | one of DSA and RSA. | |
key_size | the size of the keys, in bits. |
Definition at line 96 of file KeyPair.java.
References com.jcraft.jsch.KeyPair.DSA, com.jcraft.jsch.KeyPair.generate(), com.jcraft.jsch.KeyPair.jsch, and com.jcraft.jsch.KeyPair.RSA.
static KeyPair com.jcraft.jsch.KeyPair.genKeyPair | ( | JSch | jsch, | |
int | type | |||
) | throws JSchException [static] |
Creates a new key pair with default key size of 1024 bits.
Definition at line 84 of file KeyPair.java.
References com.jcraft.jsch.KeyPair.jsch.
abstract byte [] com.jcraft.jsch.KeyPair.getBegin | ( | ) | [package, pure virtual] |
Implemented in com.jcraft.jsch.KeyPairDSA, and com.jcraft.jsch.KeyPairRSA.
abstract byte [] com.jcraft.jsch.KeyPair.getEnd | ( | ) | [package, pure virtual] |
Implemented in com.jcraft.jsch.KeyPairDSA, and com.jcraft.jsch.KeyPairRSA.
abstract int com.jcraft.jsch.KeyPair.getKeySize | ( | ) | [package, pure virtual] |
Implemented in com.jcraft.jsch.KeyPairDSA, and com.jcraft.jsch.KeyPairRSA.
String com.jcraft.jsch.KeyPair.getPublicKeyComment | ( | ) |
Definition at line 112 of file KeyPair.java.
References com.jcraft.jsch.KeyPair.publicKeyComment.
Cipher com.jcraft.jsch.KeyPair.cipher [private] |
Definition at line 118 of file KeyPair.java.
final byte [] com.jcraft.jsch.KeyPair.cr = Util.str2byte("\n") [static, private] |
Definition at line 75 of file KeyPair.java.
final int com.jcraft.jsch.KeyPair.DSA = 1 [static] |
Key type constant: DSA.
Definition at line 60 of file KeyPair.java.
Referenced by com.jcraft.jsch.KeyPair.genKeyPair(), and com.jcraft.jsch.KeyPairDSA.getKeyType().
final int com.jcraft.jsch.KeyPair.ERROR = 0 [static] |
Key type constant: some error occured, or the keypair was not initialized.
Definition at line 56 of file KeyPair.java.
HASH com.jcraft.jsch.KeyPair.hash [private] |
Definition at line 119 of file KeyPair.java.
JSch com.jcraft.jsch.KeyPair.jsch = null [package] |
Definition at line 117 of file KeyPair.java.
Referenced by com.jcraft.jsch.KeyPairRSA.generate(), com.jcraft.jsch.KeyPairDSA.generate(), and com.jcraft.jsch.KeyPair.genKeyPair().
byte [] com.jcraft.jsch.KeyPair.passphrase [private] |
Definition at line 122 of file KeyPair.java.
String com.jcraft.jsch.KeyPair.publicKeyComment = "" [private] |
Definition at line 115 of file KeyPair.java.
Referenced by com.jcraft.jsch.KeyPair.getPublicKeyComment().
Random com.jcraft.jsch.KeyPair.random [private] |
Definition at line 120 of file KeyPair.java.
final int com.jcraft.jsch.KeyPair.RSA = 2 [static] |
Key type constant: RSA.
Definition at line 64 of file KeyPair.java.
Referenced by com.jcraft.jsch.KeyPair.genKeyPair(), and com.jcraft.jsch.KeyPairRSA.getKeyType().
final int com.jcraft.jsch.KeyPair.UNKNOWN = 3 [static] |
Key type constant: unknown key type.
This should not be used by the application.
Definition at line 69 of file KeyPair.java.
int com.jcraft.jsch.KeyPair.vendor = VENDOR_OPENSSH [package] |
Definition at line 73 of file KeyPair.java.
Referenced by com.jcraft.jsch.KeyPairRSA.parse(), and com.jcraft.jsch.KeyPairDSA.parse().
final int com.jcraft.jsch.KeyPair.VENDOR_FSECURE = 1 [static, package] |
Definition at line 72 of file KeyPair.java.
Referenced by com.jcraft.jsch.KeyPairRSA.parse(), and com.jcraft.jsch.KeyPairDSA.parse().
final int com.jcraft.jsch.KeyPair.VENDOR_OPENSSH = 0 [static, package] |
Definition at line 71 of file KeyPair.java.