com.sshtools.j2ssh.transport.publickey
Class SshtoolsPrivateKeyFormat

java.lang.Object
  extended bycom.sshtools.j2ssh.transport.publickey.Base64EncodedFileFormat
      extended bycom.sshtools.j2ssh.transport.publickey.SshtoolsPrivateKeyFormat
All Implemented Interfaces:
SshKeyFormatConversion, SshPrivateKeyFormat

public class SshtoolsPrivateKeyFormat
extends Base64EncodedFileFormat
implements SshPrivateKeyFormat

DOCUMENT ME!


Field Summary
 
Fields inherited from class com.sshtools.j2ssh.transport.publickey.Base64EncodedFileFormat
begin, end
 
Constructor Summary
SshtoolsPrivateKeyFormat()
          Creates a new SshtoolsPrivateKeyFormat object.
SshtoolsPrivateKeyFormat(java.lang.String subject, java.lang.String comment)
          Creates a new SshtoolsPrivateKeyFormat object.
 
Method Summary
 byte[] decryptKeyblob(byte[] formattedKey, java.lang.String passphrase)
          DOCUMENT ME!
 byte[] encryptKeyblob(byte[] keyblob, java.lang.String passphrase)
          DOCUMENT ME!
 java.lang.String getFormatType()
          DOCUMENT ME!
 boolean isPassphraseProtected(byte[] formattedKey)
          DOCUMENT ME!
 boolean supportsAlgorithm(java.lang.String algorithm)
          DOCUMENT ME!
 
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 - DOCUMENT ME!
comment - DOCUMENT ME!

SshtoolsPrivateKeyFormat

public SshtoolsPrivateKeyFormat()
Creates a new SshtoolsPrivateKeyFormat object.

Method Detail

getFormatType

public java.lang.String getFormatType()
DOCUMENT ME!

Specified by:
getFormatType in interface SshPrivateKeyFormat
Overrides:
getFormatType in class Base64EncodedFileFormat
Returns:
DOCUMENT ME!

isPassphraseProtected

public boolean isPassphraseProtected(byte[] formattedKey)
DOCUMENT ME!

Specified by:
isPassphraseProtected in interface SshPrivateKeyFormat
Parameters:
formattedKey - DOCUMENT ME!
Returns:
DOCUMENT ME!

decryptKeyblob

public byte[] decryptKeyblob(byte[] formattedKey,
                             java.lang.String passphrase)
                      throws InvalidSshKeyException
DOCUMENT ME!

Specified by:
decryptKeyblob in interface SshPrivateKeyFormat
Parameters:
formattedKey - DOCUMENT ME!
passphrase - DOCUMENT ME!
Returns:
DOCUMENT ME!
Throws:
InvalidSshKeyException - DOCUMENT ME!

encryptKeyblob

public byte[] encryptKeyblob(byte[] keyblob,
                             java.lang.String passphrase)
DOCUMENT ME!

Specified by:
encryptKeyblob in interface SshPrivateKeyFormat
Parameters:
keyblob - DOCUMENT ME!
passphrase - DOCUMENT ME!
Returns:
DOCUMENT ME!

supportsAlgorithm

public boolean supportsAlgorithm(java.lang.String algorithm)
DOCUMENT ME!

Specified by:
supportsAlgorithm in interface SshPrivateKeyFormat
Parameters:
algorithm - DOCUMENT ME!
Returns:
DOCUMENT ME!