com.sshtools.j2ssh.transport.publickey
Class SshtoolsPrivateKeyFormat
java.lang.Object
com.sshtools.j2ssh.transport.publickey.Base64EncodedFileFormat
com.sshtools.j2ssh.transport.publickey.SshtoolsPrivateKeyFormat
- All Implemented Interfaces:
- SshKeyFormatConversion, SshPrivateKeyFormat
public class SshtoolsPrivateKeyFormat
- extends Base64EncodedFileFormat
- implements SshPrivateKeyFormat
- Version:
- $Revision: 1.1 $
- Author:
- $author$
Field Summary |
private static java.lang.String |
BEGIN
|
private int |
cookie
|
private static java.lang.String |
END
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
BEGIN
private static java.lang.String BEGIN
END
private static java.lang.String END
cookie
private int cookie
SshtoolsPrivateKeyFormat
public SshtoolsPrivateKeyFormat(java.lang.String subject,
java.lang.String comment)
- Creates a new SshtoolsPrivateKeyFormat object.
- Parameters:
subject
- comment
-
SshtoolsPrivateKeyFormat
public SshtoolsPrivateKeyFormat()
- Creates a new SshtoolsPrivateKeyFormat object.
getFormatType
public java.lang.String getFormatType()
- Specified by:
getFormatType
in interface SshKeyFormatConversion
- Specified by:
getFormatType
in interface SshPrivateKeyFormat
- Overrides:
getFormatType
in class Base64EncodedFileFormat
- Returns:
isPassphraseProtected
public boolean isPassphraseProtected(byte[] formattedKey)
- Specified by:
isPassphraseProtected
in interface SshPrivateKeyFormat
- Parameters:
formattedKey
-
- Returns:
decryptKeyblob
public byte[] decryptKeyblob(byte[] formattedKey,
java.lang.String passphrase)
throws InvalidSshKeyException
- Specified by:
decryptKeyblob
in interface SshPrivateKeyFormat
- Parameters:
formattedKey
- passphrase
-
- Returns:
-
- Throws:
InvalidSshKeyException
encryptKeyblob
public byte[] encryptKeyblob(byte[] keyblob,
java.lang.String passphrase)
- Specified by:
encryptKeyblob
in interface SshPrivateKeyFormat
- Parameters:
keyblob
- passphrase
-
- Returns:
supportsAlgorithm
public boolean supportsAlgorithm(java.lang.String algorithm)
- Specified by:
supportsAlgorithm
in interface SshPrivateKeyFormat
- Parameters:
algorithm
-
- Returns:
makePassphraseKey
private byte[] makePassphraseKey(java.lang.String passphrase)