Class SshPrivateKeyFile
java.lang.Object
com.sshtools.j2ssh.transport.publickey.SshPrivateKeyFile
- Version:
- $Revision: 1.21 $
- Author:
- $author$
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedSshPrivateKeyFile(byte[] keyblob, SshPrivateKeyFormat format) Creates a new SshPrivateKeyFile object. -
Method Summary
Modifier and TypeMethodDescriptionvoidchangePassphrase(String oldPassphrase, String newPassphrase) static SshPrivateKeyFilecreate(SshPrivateKey key, String passphrase, SshPrivateKeyFormat format) byte[]getBytes()byte[]getKeyBlob(String passphrase) booleanstatic SshPrivateKeyFileparse(byte[] formattedKey) static SshPrivateKeyFilevoidsetFormat(SshPrivateKeyFormat newFormat, String passphrase) toPrivateKey(String passphrase) toString()
-
Constructor Details
-
SshPrivateKeyFile
Creates a new SshPrivateKeyFile object.- Parameters:
keyblob-format-
-
-
Method Details
-
getBytes
public byte[] getBytes()- Returns:
-
getKeyBlob
- Parameters:
passphrase-- Returns:
- Throws:
InvalidSshKeyException
-
changePassphrase
public void changePassphrase(String oldPassphrase, String newPassphrase) throws InvalidSshKeyException - Parameters:
oldPassphrase-newPassphrase-- Throws:
InvalidSshKeyException
-
parse
- Parameters:
formattedKey-- Returns:
- Throws:
InvalidSshKeyException
-
parse
- Parameters:
keyfile-- Returns:
- Throws:
InvalidSshKeyExceptionIOException
-
isPassphraseProtected
public boolean isPassphraseProtected()- Returns:
-
create
public static SshPrivateKeyFile create(SshPrivateKey key, String passphrase, SshPrivateKeyFormat format) throws InvalidSshKeyException - Throws:
InvalidSshKeyException
-
setFormat
public void setFormat(SshPrivateKeyFormat newFormat, String passphrase) throws InvalidSshKeyException - Parameters:
newFormat-passphrase-- Throws:
InvalidSshKeyException
-
getFormat
- Returns:
-
toPrivateKey
- Parameters:
passphrase-- Returns:
- Throws:
InvalidSshKeyException
-
toString
-