The default (internal) Identity implementation, using explicitly given public and private RSA or DSA keys. More...
Public Member Functions | |
String | getAlgName () |
Returns the name of the algorithm. | |
boolean | setPassphrase (byte[] _passphrase) throws JSchException |
byte[] | getPublicKeyBlob () |
Returns the public key data. | |
byte[] | getSignature (byte[] data) |
boolean | decrypt () |
boolean | isEncrypted () |
String | getName () |
returns the name of this identity. | |
boolean | equals (Object o) |
void | clear () |
void | finalize () |
Package Functions | |
byte[] | getPublicKeyBlob_rsa () |
byte[] | getPublicKeyBlob_dss () |
byte[] | getSignature_rsa (byte[] data) |
byte[] | getSignature_dss (byte[] data) |
boolean | decrypt_rsa () |
boolean | decrypt_dss () |
Static Package Functions | |
static IdentityFile | newInstance (String prvfile, String pubfile, JSch jsch) throws JSchException |
Creates a new IdentityFile instance from the public and private key file names. | |
static IdentityFile | newInstance (String name, byte[] prvkey, byte[] pubkey, JSch jsch) throws JSchException |
Creates a new IdentityFile instance from the public and private key data. | |
Package Attributes | |
String | identity |
byte[] | key |
byte[] | iv |
Private Member Functions | |
IdentityFile (String name, byte[] prvkey, byte[] pubkey, JSch jsch) throws JSchException | |
byte | a2b (byte c) |
Private Attributes | |
JSch | jsch |
HASH | hash |
byte[] | encoded_data |
Cipher | cipher |
byte[] | P_array |
byte[] | Q_array |
byte[] | G_array |
byte[] | pub_array |
byte[] | prv_array |
byte[] | n_array |
byte[] | e_array |
byte[] | d_array |
String | algname = "ssh-rsa" |
int | type = ERROR |
int | keytype = OPENSSH |
byte[] | publickeyblob = null |
boolean | encrypted = true |
Static Private Attributes | |
static final int | ERROR = 0 |
static final int | RSA = 1 |
static final int | DSS = 2 |
static final int | UNKNOWN = 3 |
static final int | OPENSSH = 0 |
static final int | FSECURE = 1 |
static final int | PUTTY = 2 |
The default (internal) Identity implementation, using explicitly given public and private RSA or DSA keys.
Definition at line 39 of file IdentityFile.java.
com.jcraft.jsch.IdentityFile.IdentityFile | ( | String | name, | |
byte[] | prvkey, | |||
byte[] | pubkey, | |||
JSch | jsch | |||
) | throws JSchException [private] |
Definition at line 157 of file IdentityFile.java.
References com.jcraft.jsch.IdentityFile.a2b(), com.jcraft.jsch.IdentityFile.cipher, com.jcraft.jsch.IdentityFile.DSS, com.jcraft.jsch.IdentityFile.encoded_data, com.jcraft.jsch.IdentityFile.encrypted, com.jcraft.jsch.IdentityFile.ERROR, com.jcraft.jsch.IdentityFile.FSECURE, com.jcraft.jsch.IdentityFile.hash, com.jcraft.jsch.IdentityFile.identity, com.jcraft.jsch.HASH.init(), com.jcraft.jsch.IdentityFile.iv, com.jcraft.jsch.IdentityFile.jsch, com.jcraft.jsch.IdentityFile.key, com.jcraft.jsch.IdentityFile.keytype, com.jcraft.jsch.IdentityFile.publickeyblob, com.jcraft.jsch.IdentityFile.RSA, com.jcraft.jsch.IdentityFile.type, and com.jcraft.jsch.IdentityFile.UNKNOWN.
Referenced by com.jcraft.jsch.IdentityFile.newInstance().
byte com.jcraft.jsch.IdentityFile.a2b | ( | byte | c | ) | [private] |
Definition at line 912 of file IdentityFile.java.
Referenced by com.jcraft.jsch.IdentityFile.IdentityFile().
void com.jcraft.jsch.IdentityFile.clear | ( | ) |
Definition at line 925 of file IdentityFile.java.
References com.jcraft.jsch.IdentityFile.d_array, com.jcraft.jsch.IdentityFile.encoded_data, com.jcraft.jsch.IdentityFile.iv, com.jcraft.jsch.IdentityFile.key, and com.jcraft.jsch.IdentityFile.prv_array.
Referenced by com.jcraft.jsch.IdentityFile.finalize().
boolean com.jcraft.jsch.IdentityFile.decrypt | ( | ) |
Definition at line 573 of file IdentityFile.java.
References com.jcraft.jsch.IdentityFile.decrypt_dss(), com.jcraft.jsch.IdentityFile.decrypt_rsa(), com.jcraft.jsch.IdentityFile.RSA, and com.jcraft.jsch.IdentityFile.type.
Referenced by com.jcraft.jsch.IdentityFile.setPassphrase().
boolean com.jcraft.jsch.IdentityFile.decrypt_dss | ( | ) | [package] |
Definition at line 784 of file IdentityFile.java.
References com.jcraft.jsch.IdentityFile.cipher, com.jcraft.jsch.IdentityFile.encoded_data, com.jcraft.jsch.IdentityFile.encrypted, com.jcraft.jsch.IdentityFile.FSECURE, com.jcraft.jsch.IdentityFile.G_array, com.jcraft.jsch.IdentityFile.iv, com.jcraft.jsch.IdentityFile.key, com.jcraft.jsch.IdentityFile.keytype, com.jcraft.jsch.IdentityFile.OPENSSH, com.jcraft.jsch.IdentityFile.P_array, com.jcraft.jsch.IdentityFile.prv_array, com.jcraft.jsch.IdentityFile.pub_array, and com.jcraft.jsch.IdentityFile.Q_array.
Referenced by com.jcraft.jsch.IdentityFile.decrypt().
boolean com.jcraft.jsch.IdentityFile.decrypt_rsa | ( | ) | [package] |
Definition at line 578 of file IdentityFile.java.
References com.jcraft.jsch.IdentityFile.cipher, com.jcraft.jsch.IdentityFile.d_array, com.jcraft.jsch.IdentityFile.e_array, com.jcraft.jsch.IdentityFile.encoded_data, com.jcraft.jsch.IdentityFile.encrypted, com.jcraft.jsch.IdentityFile.FSECURE, com.jcraft.jsch.IdentityFile.iv, com.jcraft.jsch.IdentityFile.key, com.jcraft.jsch.IdentityFile.keytype, com.jcraft.jsch.IdentityFile.n_array, and com.jcraft.jsch.IdentityFile.OPENSSH.
Referenced by com.jcraft.jsch.IdentityFile.decrypt().
boolean com.jcraft.jsch.IdentityFile.equals | ( | Object | o | ) |
Definition at line 919 of file IdentityFile.java.
References com.jcraft.jsch.IdentityFile.getName().
void com.jcraft.jsch.IdentityFile.finalize | ( | ) |
Definition at line 933 of file IdentityFile.java.
References com.jcraft.jsch.IdentityFile.clear().
String com.jcraft.jsch.IdentityFile.getAlgName | ( | ) |
Returns the name of the algorithm.
This will be sent together with the public key to the server for authorization purposes. The server will use the signature checking algorithm to check the signature.
Implements com.jcraft.jsch.Identity.
Definition at line 411 of file IdentityFile.java.
References com.jcraft.jsch.IdentityFile.RSA, and com.jcraft.jsch.IdentityFile.type.
String com.jcraft.jsch.IdentityFile.getName | ( | ) |
returns the name of this identity.
This is only used by the library for bookkeeping purposes (and allows the application to JSch#removeIdentity remove an identity), is not sent to the server.
Implements com.jcraft.jsch.Identity.
Definition at line 908 of file IdentityFile.java.
References com.jcraft.jsch.IdentityFile.identity.
Referenced by com.jcraft.jsch.IdentityFile.equals().
byte [] com.jcraft.jsch.IdentityFile.getPublicKeyBlob | ( | ) |
Returns the public key data.
This will be sent to the server, which then will check the key is authorized for this user (and whether the signature is done with the corresponding private key).
Implements com.jcraft.jsch.Identity.
Definition at line 469 of file IdentityFile.java.
References com.jcraft.jsch.IdentityFile.getPublicKeyBlob_dss(), com.jcraft.jsch.IdentityFile.getPublicKeyBlob_rsa(), com.jcraft.jsch.IdentityFile.publickeyblob, com.jcraft.jsch.IdentityFile.RSA, and com.jcraft.jsch.IdentityFile.type.
byte [] com.jcraft.jsch.IdentityFile.getPublicKeyBlob_dss | ( | ) | [package] |
Definition at line 486 of file IdentityFile.java.
References com.jcraft.jsch.Buffer.buffer, com.jcraft.jsch.IdentityFile.G_array, com.jcraft.jsch.IdentityFile.P_array, com.jcraft.jsch.IdentityFile.pub_array, and com.jcraft.jsch.IdentityFile.Q_array.
Referenced by com.jcraft.jsch.IdentityFile.getPublicKeyBlob().
byte [] com.jcraft.jsch.IdentityFile.getPublicKeyBlob_rsa | ( | ) | [package] |
Definition at line 475 of file IdentityFile.java.
References com.jcraft.jsch.Buffer.buffer, com.jcraft.jsch.IdentityFile.e_array, and com.jcraft.jsch.IdentityFile.n_array.
Referenced by com.jcraft.jsch.IdentityFile.getPublicKeyBlob().
byte [] com.jcraft.jsch.IdentityFile.getSignature | ( | byte[] | data | ) |
Definition at line 501 of file IdentityFile.java.
References com.jcraft.jsch.IdentityFile.getSignature_dss(), com.jcraft.jsch.IdentityFile.getSignature_rsa(), com.jcraft.jsch.IdentityFile.RSA, and com.jcraft.jsch.IdentityFile.type.
byte [] com.jcraft.jsch.IdentityFile.getSignature_dss | ( | byte[] | data | ) | [package] |
Definition at line 529 of file IdentityFile.java.
References com.jcraft.jsch.Buffer.buffer, com.jcraft.jsch.IdentityFile.G_array, com.jcraft.jsch.IdentityFile.jsch, com.jcraft.jsch.IdentityFile.P_array, com.jcraft.jsch.IdentityFile.prv_array, and com.jcraft.jsch.IdentityFile.Q_array.
Referenced by com.jcraft.jsch.IdentityFile.getSignature().
byte [] com.jcraft.jsch.IdentityFile.getSignature_rsa | ( | byte[] | data | ) | [package] |
Definition at line 506 of file IdentityFile.java.
References com.jcraft.jsch.Buffer.buffer, com.jcraft.jsch.IdentityFile.d_array, com.jcraft.jsch.IdentityFile.jsch, and com.jcraft.jsch.IdentityFile.n_array.
Referenced by com.jcraft.jsch.IdentityFile.getSignature().
boolean com.jcraft.jsch.IdentityFile.isEncrypted | ( | ) |
Definition at line 904 of file IdentityFile.java.
References com.jcraft.jsch.IdentityFile.encrypted.
static IdentityFile com.jcraft.jsch.IdentityFile.newInstance | ( | String | name, | |
byte[] | prvkey, | |||
byte[] | pubkey, | |||
JSch | jsch | |||
) | throws JSchException [static, package] |
Creates a new IdentityFile instance from the public and private key data.
The private key array will be zeroed out after reading.
Definition at line 148 of file IdentityFile.java.
References com.jcraft.jsch.IdentityFile.IdentityFile(), and com.jcraft.jsch.IdentityFile.jsch.
static IdentityFile com.jcraft.jsch.IdentityFile.newInstance | ( | String | prvfile, | |
String | pubfile, | |||
JSch | jsch | |||
) | throws JSchException [static, package] |
Creates a new IdentityFile instance from the public and private key file names.
Definition at line 85 of file IdentityFile.java.
References com.jcraft.jsch.IdentityFile.jsch.
boolean com.jcraft.jsch.IdentityFile.setPassphrase | ( | byte[] | _passphrase | ) | throws JSchException |
Definition at line 416 of file IdentityFile.java.
References com.jcraft.jsch.IdentityFile.decrypt(), com.jcraft.jsch.IdentityFile.encrypted, com.jcraft.jsch.IdentityFile.FSECURE, com.jcraft.jsch.IdentityFile.G_array, com.jcraft.jsch.HASH.getBlockSize(), com.jcraft.jsch.IdentityFile.hash, com.jcraft.jsch.IdentityFile.iv, com.jcraft.jsch.IdentityFile.key, com.jcraft.jsch.IdentityFile.keytype, com.jcraft.jsch.IdentityFile.OPENSSH, com.jcraft.jsch.IdentityFile.P_array, com.jcraft.jsch.IdentityFile.prv_array, com.jcraft.jsch.IdentityFile.pub_array, and com.jcraft.jsch.IdentityFile.Q_array.
String com.jcraft.jsch.IdentityFile.algname = "ssh-rsa" [private] |
Definition at line 62 of file IdentityFile.java.
Cipher com.jcraft.jsch.IdentityFile.cipher [private] |
Definition at line 47 of file IdentityFile.java.
Referenced by com.jcraft.jsch.IdentityFile.decrypt_dss(), com.jcraft.jsch.IdentityFile.decrypt_rsa(), and com.jcraft.jsch.IdentityFile.IdentityFile().
byte [] com.jcraft.jsch.IdentityFile.d_array [private] |
Definition at line 59 of file IdentityFile.java.
Referenced by com.jcraft.jsch.IdentityFile.clear(), com.jcraft.jsch.IdentityFile.decrypt_rsa(), and com.jcraft.jsch.IdentityFile.getSignature_rsa().
final int com.jcraft.jsch.IdentityFile.DSS = 2 [static, private] |
Definition at line 66 of file IdentityFile.java.
Referenced by com.jcraft.jsch.IdentityFile.IdentityFile().
byte [] com.jcraft.jsch.IdentityFile.e_array [private] |
Definition at line 58 of file IdentityFile.java.
Referenced by com.jcraft.jsch.IdentityFile.decrypt_rsa(), and com.jcraft.jsch.IdentityFile.getPublicKeyBlob_rsa().
byte [] com.jcraft.jsch.IdentityFile.encoded_data [private] |
Definition at line 45 of file IdentityFile.java.
Referenced by com.jcraft.jsch.IdentityFile.clear(), com.jcraft.jsch.IdentityFile.decrypt_dss(), com.jcraft.jsch.IdentityFile.decrypt_rsa(), and com.jcraft.jsch.IdentityFile.IdentityFile().
boolean com.jcraft.jsch.IdentityFile.encrypted = true [private] |
final int com.jcraft.jsch.IdentityFile.ERROR = 0 [static, private] |
Definition at line 64 of file IdentityFile.java.
Referenced by com.jcraft.jsch.IdentityFile.IdentityFile().
final int com.jcraft.jsch.IdentityFile.FSECURE = 1 [static, private] |
Definition at line 70 of file IdentityFile.java.
Referenced by com.jcraft.jsch.IdentityFile.decrypt_dss(), com.jcraft.jsch.IdentityFile.decrypt_rsa(), com.jcraft.jsch.IdentityFile.IdentityFile(), and com.jcraft.jsch.IdentityFile.setPassphrase().
byte [] com.jcraft.jsch.IdentityFile.G_array [private] |
Definition at line 52 of file IdentityFile.java.
Referenced by com.jcraft.jsch.IdentityFile.decrypt_dss(), com.jcraft.jsch.IdentityFile.getPublicKeyBlob_dss(), com.jcraft.jsch.IdentityFile.getSignature_dss(), and com.jcraft.jsch.IdentityFile.setPassphrase().
HASH com.jcraft.jsch.IdentityFile.hash [private] |
Definition at line 44 of file IdentityFile.java.
Referenced by com.jcraft.jsch.IdentityFile.IdentityFile(), and com.jcraft.jsch.IdentityFile.setPassphrase().
String com.jcraft.jsch.IdentityFile.identity [package] |
Definition at line 40 of file IdentityFile.java.
Referenced by com.jcraft.jsch.IdentityFile.getName(), and com.jcraft.jsch.IdentityFile.IdentityFile().
byte [] com.jcraft.jsch.IdentityFile.iv [package] |
Definition at line 42 of file IdentityFile.java.
Referenced by com.jcraft.jsch.IdentityFile.clear(), com.jcraft.jsch.IdentityFile.decrypt_dss(), com.jcraft.jsch.IdentityFile.decrypt_rsa(), com.jcraft.jsch.IdentityFile.IdentityFile(), and com.jcraft.jsch.IdentityFile.setPassphrase().
JSch com.jcraft.jsch.IdentityFile.jsch [private] |
Definition at line 43 of file IdentityFile.java.
Referenced by com.jcraft.jsch.IdentityFile.getSignature_dss(), com.jcraft.jsch.IdentityFile.getSignature_rsa(), com.jcraft.jsch.IdentityFile.IdentityFile(), and com.jcraft.jsch.IdentityFile.newInstance().
byte [] com.jcraft.jsch.IdentityFile.key [package] |
Definition at line 41 of file IdentityFile.java.
Referenced by com.jcraft.jsch.IdentityFile.clear(), com.jcraft.jsch.IdentityFile.decrypt_dss(), com.jcraft.jsch.IdentityFile.decrypt_rsa(), com.jcraft.jsch.IdentityFile.IdentityFile(), and com.jcraft.jsch.IdentityFile.setPassphrase().
int com.jcraft.jsch.IdentityFile.keytype = OPENSSH [private] |
Definition at line 74 of file IdentityFile.java.
Referenced by com.jcraft.jsch.IdentityFile.decrypt_dss(), com.jcraft.jsch.IdentityFile.decrypt_rsa(), com.jcraft.jsch.IdentityFile.IdentityFile(), and com.jcraft.jsch.IdentityFile.setPassphrase().
byte [] com.jcraft.jsch.IdentityFile.n_array [private] |
Definition at line 57 of file IdentityFile.java.
Referenced by com.jcraft.jsch.IdentityFile.decrypt_rsa(), com.jcraft.jsch.IdentityFile.getPublicKeyBlob_rsa(), and com.jcraft.jsch.IdentityFile.getSignature_rsa().
final int com.jcraft.jsch.IdentityFile.OPENSSH = 0 [static, private] |
Definition at line 69 of file IdentityFile.java.
Referenced by com.jcraft.jsch.IdentityFile.decrypt_dss(), com.jcraft.jsch.IdentityFile.decrypt_rsa(), and com.jcraft.jsch.IdentityFile.setPassphrase().
byte [] com.jcraft.jsch.IdentityFile.P_array [private] |
Definition at line 50 of file IdentityFile.java.
Referenced by com.jcraft.jsch.IdentityFile.decrypt_dss(), com.jcraft.jsch.IdentityFile.getPublicKeyBlob_dss(), com.jcraft.jsch.IdentityFile.getSignature_dss(), and com.jcraft.jsch.IdentityFile.setPassphrase().
byte [] com.jcraft.jsch.IdentityFile.prv_array [private] |
Definition at line 54 of file IdentityFile.java.
Referenced by com.jcraft.jsch.IdentityFile.clear(), com.jcraft.jsch.IdentityFile.decrypt_dss(), com.jcraft.jsch.IdentityFile.getSignature_dss(), and com.jcraft.jsch.IdentityFile.setPassphrase().
byte [] com.jcraft.jsch.IdentityFile.pub_array [private] |
Definition at line 53 of file IdentityFile.java.
Referenced by com.jcraft.jsch.IdentityFile.decrypt_dss(), com.jcraft.jsch.IdentityFile.getPublicKeyBlob_dss(), and com.jcraft.jsch.IdentityFile.setPassphrase().
byte [] com.jcraft.jsch.IdentityFile.publickeyblob = null [private] |
Definition at line 76 of file IdentityFile.java.
Referenced by com.jcraft.jsch.IdentityFile.getPublicKeyBlob(), and com.jcraft.jsch.IdentityFile.IdentityFile().
final int com.jcraft.jsch.IdentityFile.PUTTY = 2 [static, private] |
Definition at line 71 of file IdentityFile.java.
byte [] com.jcraft.jsch.IdentityFile.Q_array [private] |
Definition at line 51 of file IdentityFile.java.
Referenced by com.jcraft.jsch.IdentityFile.decrypt_dss(), com.jcraft.jsch.IdentityFile.getPublicKeyBlob_dss(), com.jcraft.jsch.IdentityFile.getSignature_dss(), and com.jcraft.jsch.IdentityFile.setPassphrase().
final int com.jcraft.jsch.IdentityFile.RSA = 1 [static, private] |
int com.jcraft.jsch.IdentityFile.type = ERROR [private] |
final int com.jcraft.jsch.IdentityFile.UNKNOWN = 3 [static, private] |
Definition at line 67 of file IdentityFile.java.
Referenced by com.jcraft.jsch.IdentityFile.IdentityFile().