Class SshPrivateKeyFile
java.lang.Object
com.sshtools.j2ssh.transport.publickey.SshPrivateKeyFile
- Version:
- $Revision: 1.21 $
- Author:
- $author$
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
SshPrivateKeyFile
(byte[] keyblob, SshPrivateKeyFormat format) Creates a new SshPrivateKeyFile object. -
Method Summary
Modifier and TypeMethodDescriptionvoid
changePassphrase
(String oldPassphrase, String newPassphrase) static SshPrivateKeyFile
create
(SshPrivateKey key, String passphrase, SshPrivateKeyFormat format) byte[]
getBytes()
byte[]
getKeyBlob
(String passphrase) boolean
static SshPrivateKeyFile
parse
(byte[] formattedKey) static SshPrivateKeyFile
void
setFormat
(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:
InvalidSshKeyException
IOException
-
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
-