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 protected
SshPublicKeyFile(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 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()
-
-
-
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 classjava.lang.Object
- Returns:
-
-