Class SshPublicKeyFile
- java.lang.Object
-
- com.sshtools.j2ssh.transport.publickey.SshPublicKeyFile
-
public class SshPublicKeyFile extends java.lang.Object- Version:
- $Revision: 1.20 $
- Author:
- $author$
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedSshPublicKeyFile(byte[] keyblob, SshPublicKeyFormat format)Creates a new SshPublicKeyFile object.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static SshPublicKeyFilecreate(SshPublicKey key, SshPublicKeyFormat format)java.lang.StringgetAlgorithm()byte[]getBytes()java.lang.StringgetComment()SshPublicKeyFormatgetFormat()byte[]getKeyBlob()static SshPublicKeyFileparse(byte[] formattedKey)static SshPublicKeyFileparse(java.io.File keyfile)voidsetComment(java.lang.String comment)voidsetFormat(SshPublicKeyFormat newFormat)SshPublicKeytoPublicKey()java.lang.StringtoString()
-
-
-
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:
InvalidSshKeyExceptionjava.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:
toStringin classjava.lang.Object- Returns:
-
-