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.22 $
- Author:
- $author$
-
Field Summary
Fields inherited from class com.sshtools.j2ssh.transport.publickey.Base64EncodedFileFormat
begin, end
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new SshtoolsPrivateKeyFormat object.SshtoolsPrivateKeyFormat
(String subject, String comment) Creates a new SshtoolsPrivateKeyFormat object. -
Method Summary
Modifier and TypeMethodDescriptionbyte[]
decryptKeyblob
(byte[] formattedKey, String passphrase) byte[]
encryptKeyblob
(byte[] keyblob, String passphrase) boolean
isPassphraseProtected
(byte[] formattedKey) boolean
supportsAlgorithm
(String algorithm) Methods inherited from class com.sshtools.j2ssh.transport.publickey.Base64EncodedFileFormat
formatKey, getHeaderValue, getKeyBlob, isFormatted, setHeaderValue
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.sshtools.j2ssh.transport.publickey.SshPrivateKeyFormat
isFormatted
-
Constructor Details
-
SshtoolsPrivateKeyFormat
Creates a new SshtoolsPrivateKeyFormat object.- Parameters:
subject
-comment
-
-
SshtoolsPrivateKeyFormat
public SshtoolsPrivateKeyFormat()Creates a new SshtoolsPrivateKeyFormat object.
-
-
Method Details
-
getFormatType
- Specified by:
getFormatType
in interfaceSshKeyFormatConversion
- Specified by:
getFormatType
in interfaceSshPrivateKeyFormat
- Overrides:
getFormatType
in classBase64EncodedFileFormat
- Returns:
-
isPassphraseProtected
public boolean isPassphraseProtected(byte[] formattedKey) - Specified by:
isPassphraseProtected
in interfaceSshPrivateKeyFormat
- Parameters:
formattedKey
-- Returns:
-
decryptKeyblob
- Specified by:
decryptKeyblob
in interfaceSshPrivateKeyFormat
- Parameters:
formattedKey
-passphrase
-- Returns:
- Throws:
InvalidSshKeyException
-
encryptKeyblob
- Specified by:
encryptKeyblob
in interfaceSshPrivateKeyFormat
- Parameters:
keyblob
-passphrase
-- Returns:
-
supportsAlgorithm
- Specified by:
supportsAlgorithm
in interfaceSshPrivateKeyFormat
- Parameters:
algorithm
-- Returns:
-