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
Constructors Constructor Description SshtoolsPrivateKeyFormat()Creates a new SshtoolsPrivateKeyFormat object.SshtoolsPrivateKeyFormat(java.lang.String subject, java.lang.String comment)Creates a new SshtoolsPrivateKeyFormat object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]decryptKeyblob(byte[] formattedKey, java.lang.String passphrase)byte[]encryptKeyblob(byte[] keyblob, java.lang.String passphrase)java.lang.StringgetFormatType()booleanisPassphraseProtected(byte[] formattedKey)booleansupportsAlgorithm(java.lang.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 Detail
-
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.
-
-
Method Detail
-
getFormatType
public java.lang.String getFormatType()
- Specified by:
getFormatTypein interfaceSshKeyFormatConversion- Specified by:
getFormatTypein interfaceSshPrivateKeyFormat- Overrides:
getFormatTypein classBase64EncodedFileFormat- Returns:
-
isPassphraseProtected
public boolean isPassphraseProtected(byte[] formattedKey)
- Specified by:
isPassphraseProtectedin interfaceSshPrivateKeyFormat- Parameters:
formattedKey-- Returns:
-
decryptKeyblob
public byte[] decryptKeyblob(byte[] formattedKey, java.lang.String passphrase) throws InvalidSshKeyException- Specified by:
decryptKeyblobin interfaceSshPrivateKeyFormat- Parameters:
formattedKey-passphrase-- Returns:
- Throws:
InvalidSshKeyException
-
encryptKeyblob
public byte[] encryptKeyblob(byte[] keyblob, java.lang.String passphrase)- Specified by:
encryptKeyblobin interfaceSshPrivateKeyFormat- Parameters:
keyblob-passphrase-- Returns:
-
supportsAlgorithm
public boolean supportsAlgorithm(java.lang.String algorithm)
- Specified by:
supportsAlgorithmin interfaceSshPrivateKeyFormat- Parameters:
algorithm-- Returns:
-
-