Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
java.lang.Object
com.sshtools.j2ssh.transport.publickey.SshPrivateKeyFile
public class SshPrivateKeyFile
extends java.lang.Object
Constructor Summary | |
|
Method Summary | |
void |
|
static SshPrivateKeyFile |
|
byte[] |
|
SshPrivateKeyFormat | |
byte[] |
|
boolean | |
static SshPrivateKeyFile |
|
static SshPrivateKeyFile |
|
void |
|
SshPrivateKey |
|
String |
|
protected SshPrivateKeyFile(byte[] keyblob, SshPrivateKeyFormat format)
Creates a new SshPrivateKeyFile object.
- Parameters:
keyblob
-format
-
public void changePassphrase(String oldPassphrase, String newPassphrase) throws InvalidSshKeyException
- Parameters:
oldPassphrase
-newPassphrase
-
- Throws:
InvalidSshKeyException
-
public static SshPrivateKeyFile create(SshPrivateKey key, String passphrase, SshPrivateKeyFormat format) throws InvalidSshKeyException
public byte[] getBytes()
- Returns:
public byte[] getKeyBlob(String passphrase) throws InvalidSshKeyException
- Parameters:
passphrase
-
- Returns:
- Throws:
InvalidSshKeyException
-
public boolean isPassphraseProtected()
- Returns:
public static SshPrivateKeyFile parse(File keyfile) throws InvalidSshKeyException, IOException
- Parameters:
keyfile
-
- Returns:
- Throws:
InvalidSshKeyException
-
public static SshPrivateKeyFile parse(byte[] formattedKey) throws InvalidSshKeyException
- Parameters:
formattedKey
-
- Returns:
- Throws:
InvalidSshKeyException
-
public void setFormat(SshPrivateKeyFormat newFormat, String passphrase) throws InvalidSshKeyException
- Parameters:
newFormat
-passphrase
-
- Throws:
InvalidSshKeyException
-
public SshPrivateKey toPrivateKey(String passphrase) throws InvalidSshKeyException
- Parameters:
passphrase
-
- Returns:
- Throws:
InvalidSshKeyException
-
public String toString()
- Returns: