com.sshtools.j2ssh.transport.publickey
Class SshPublicKeyFile

java.lang.Object
  extended by com.sshtools.j2ssh.transport.publickey.SshPublicKeyFile

public class SshPublicKeyFile
extends java.lang.Object

Version:
$Revision: 1.1 $
Author:
$author$

Field Summary
private  java.lang.String comment
           
private  SshPublicKeyFormat format
           
private  byte[] keyblob
           
private static org.apache.commons.logging.Log log
           
 
Constructor Summary
protected SshPublicKeyFile(byte[] keyblob, SshPublicKeyFormat format)
          Creates a new SshPublicKeyFile object.
 
Method Summary
static SshPublicKeyFile create(SshPublicKey key, SshPublicKeyFormat format)
           
 java.lang.String getAlgorithm()
           
 byte[] getBytes()
           
 java.lang.String getComment()
           
 SshPublicKeyFormat getFormat()
           
 byte[] getKeyBlob()
           
static SshPublicKeyFile parse(byte[] formattedKey)
           
static SshPublicKeyFile parse(java.io.File keyfile)
           
 void setComment(java.lang.String comment)
           
 void setFormat(SshPublicKeyFormat newFormat)
           
 SshPublicKey toPublicKey()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

log

private static org.apache.commons.logging.Log log

format

private SshPublicKeyFormat format

keyblob

private byte[] keyblob

comment

private java.lang.String comment
Constructor Detail

SshPublicKeyFile

protected SshPublicKeyFile(byte[] keyblob,
                           SshPublicKeyFormat format)
Creates a new SshPublicKeyFile object.

Parameters:
keyblob -
format -
Method Detail

getBytes

public byte[] getBytes()
Returns:

getComment

public java.lang.String getComment()
Returns:

setComment

public void setComment(java.lang.String comment)
Parameters:
comment -

getKeyBlob

public byte[] getKeyBlob()
Returns:

create

public static SshPublicKeyFile create(SshPublicKey key,
                                      SshPublicKeyFormat format)
Parameters:
key -
format -
Returns:

parse

public static SshPublicKeyFile parse(java.io.File keyfile)
                              throws InvalidSshKeyException,
                                     java.io.IOException
Parameters:
keyfile -
Returns:
Throws:
InvalidSshKeyException
java.io.IOException

parse

public static SshPublicKeyFile parse(byte[] formattedKey)
                              throws InvalidSshKeyException
Parameters:
formattedKey -
Returns:
Throws:
InvalidSshKeyException

getAlgorithm

public java.lang.String getAlgorithm()
Returns:

setFormat

public void setFormat(SshPublicKeyFormat newFormat)
               throws InvalidSshKeyException
Parameters:
newFormat -
Throws:
InvalidSshKeyException

getFormat

public SshPublicKeyFormat getFormat()
Returns:

toPublicKey

public SshPublicKey toPublicKey()
                         throws java.io.IOException
Returns:
Throws:
java.io.IOException

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object
Returns: