com.jcraft.jsch.KeyPair Class Reference

Base class for a pair of public and private key. More...

Inheritance diagram for com.jcraft.jsch.KeyPair:
Inheritance graph
[legend]
Collaboration diagram for com.jcraft.jsch.KeyPair:
Collaboration graph
[legend]

List of all members.

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")

Detailed Description

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.


Member Function Documentation

abstract void com.jcraft.jsch.KeyPair.generate ( int  key_size  )  throws JSchException [package, pure virtual]
static KeyPair com.jcraft.jsch.KeyPair.genKeyPair ( JSch  jsch,
int  type,
int  key_size 
) throws JSchException [static]

Creates a new key pair.

Parameters:
jsch the JSch object used for configuration purposes.
type one of DSA and RSA.
key_size the size of the keys, in bits.
Returns:
null if a unknown type constant is given, else the new key pair.

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.

Parameters:
jsch the JSch object used for configuration purposes.
type one of DSA and RSA.
Returns:
null if a unknown type constant is given, else the new key pair.

Definition at line 84 of file KeyPair.java.

References com.jcraft.jsch.KeyPair.jsch.

abstract byte [] com.jcraft.jsch.KeyPair.getBegin (  )  [package, pure virtual]
abstract byte [] com.jcraft.jsch.KeyPair.getEnd (  )  [package, pure virtual]
abstract int com.jcraft.jsch.KeyPair.getKeySize (  )  [package, pure virtual]
String com.jcraft.jsch.KeyPair.getPublicKeyComment (  ) 

Definition at line 112 of file KeyPair.java.

References com.jcraft.jsch.KeyPair.publicKeyComment.


Member Data Documentation

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.

Definition at line 119 of file KeyPair.java.

Definition at line 122 of file KeyPair.java.

Definition at line 115 of file KeyPair.java.

Referenced by com.jcraft.jsch.KeyPair.getPublicKeyComment().

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.

final int com.jcraft.jsch.KeyPair.VENDOR_FSECURE = 1 [static, package]
final int com.jcraft.jsch.KeyPair.VENDOR_OPENSSH = 0 [static, package]

Definition at line 71 of file KeyPair.java.


The documentation for this class was generated from the following file:

Generated on 5 May 2015 for HPCVIEWER by  doxygen 1.6.1