com.mindbright.ssh2
public class SSH2PublicKeyFile extends java.lang.Object
SSH2KeyPairFile
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
BEGIN_PUB_KEY |
static java.lang.String |
END_PUB_KEY |
static java.lang.String |
FILE_COMMENT |
static java.lang.String |
FILE_SUBJECT |
Constructor and Description |
---|
SSH2PublicKeyFile()
This is the constructor used for loading a public key.
|
SSH2PublicKeyFile(java.security.PublicKey publicKey,
java.lang.String subject,
java.lang.String comment)
This is the constructor used for storing a public key.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getAlgorithmName() |
static java.lang.String |
getAlgorithmName(java.security.PublicKey key) |
java.lang.String |
getComment() |
java.security.PublicKey |
getPublicKey() |
byte[] |
getRaw() |
java.lang.String |
getSubject() |
boolean |
isPuttyFormat() |
boolean |
isSSHComFormat() |
void |
load(java.io.InputStream in) |
void |
load(java.io.InputStream in,
java.lang.String password) |
void |
load(java.lang.String fileName) |
void |
load(java.lang.String fileName,
java.lang.String password) |
boolean |
sameAs(java.security.PublicKey other) |
void |
setComment(java.lang.String comment) |
void |
setSubject(java.lang.String subject) |
java.lang.String |
store(boolean sshComFormat) |
java.lang.String |
store(java.lang.String fileName) |
java.lang.String |
store(java.lang.String fileName,
boolean sshComFormat) |
public static final java.lang.String BEGIN_PUB_KEY
public static final java.lang.String END_PUB_KEY
public static final java.lang.String FILE_SUBJECT
public static final java.lang.String FILE_COMMENT
public SSH2PublicKeyFile(java.security.PublicKey publicKey, java.lang.String subject, java.lang.String comment)
publicKey
- the public key to storesubject
- the subject name of the key ownercomment
- a comment to accompany the keypublic SSH2PublicKeyFile()
public static java.lang.String getAlgorithmName(java.security.PublicKey key)
public java.lang.String getAlgorithmName()
public boolean isSSHComFormat()
public boolean isPuttyFormat()
public void load(java.lang.String fileName) throws java.io.IOException, SSH2Exception
java.io.IOException
SSH2Exception
public void load(java.lang.String fileName, java.lang.String password) throws java.io.IOException, SSH2Exception
java.io.IOException
SSH2Exception
public void load(java.io.InputStream in) throws java.io.IOException, SSH2Exception
java.io.IOException
SSH2Exception
public void load(java.io.InputStream in, java.lang.String password) throws java.io.IOException, SSH2Exception
java.io.IOException
SSH2Exception
public java.lang.String store(java.lang.String fileName) throws java.io.IOException, SSH2Exception
java.io.IOException
SSH2Exception
public java.lang.String store(java.lang.String fileName, boolean sshComFormat) throws java.io.IOException, SSH2Exception
java.io.IOException
SSH2Exception
public java.lang.String store(boolean sshComFormat) throws SSH2Exception
SSH2Exception
public java.security.PublicKey getPublicKey()
public byte[] getRaw() throws SSH2Exception
SSH2Exception
public java.lang.String getSubject()
public void setSubject(java.lang.String subject)
public java.lang.String getComment()
public void setComment(java.lang.String comment)
public boolean sameAs(java.security.PublicKey other)