public interface SshPrivateKeyFile
SshPrivateKey. Provider implementations are capable of reading some known
private key format, and presenting as an instance of this interface.
The formatted key may be encrypted if the format/provider supports.
| Modifier and Type | Field and Description |
|---|---|
static int |
TYPE_DSA
DSA
|
static int |
TYPE_RSA
RSA
|
static int |
TYPE_UNKNOWN
Unknown
|
static int |
VENDOR_FSECURE
FSecure
|
static int |
VENDOR_OPENSSH
OpenSSH
|
static int |
VENDOR_PUTTY
Putty.
|
static int |
VENDOR_SSH1
SSH1.
|
static int |
VENDOR_SSHCOM
SSH Communications Security
|
static int |
VENDOR_SSHTOOLS
SSHTools
|
static int |
VENDOR_UNKNOWN
Unknown
|
| Modifier and Type | Method and Description |
|---|---|
void |
changePassphrase(char[] newPassphrase)
Change the passphrase of this key.
|
void |
decrypt(char[] passphrase)
Decrypt a formatted key.
|
int |
getFormat()
Get the format of the key.
|
byte[] |
getFormattedKey()
Format the key so it can be written.
|
boolean |
isEncrypted()
Get if this key is currently encrypted.
|
boolean |
supportsPassphraseChange()
Get whether changing of the key passphrase is supported.
|
SshKeyPair |
toKeyPair()
Get the actual key pair.
|
static final int TYPE_RSA
static final int TYPE_DSA
static final int TYPE_UNKNOWN
static final int VENDOR_OPENSSH
static final int VENDOR_FSECURE
static final int VENDOR_UNKNOWN
static final int VENDOR_SSHTOOLS
static final int VENDOR_SSH1
static final int VENDOR_PUTTY
static final int VENDOR_SSHCOM
byte[] getFormattedKey()
throws SshException
SshExceptionvoid decrypt(char[] passphrase)
throws SshException
passphrase - SshException#isEncrypted()}void changePassphrase(char[] newPassphrase)
throws SshException
decrypt(char[])
first if it is encrypted.newPassphrase - new passphraseSshExceptionboolean isEncrypted()
throws SshException
SshExceptionboolean supportsPassphraseChange()
int getFormat()
SshKeyPair toKeyPair() throws SshException
SshExceptionCopyright © 2018. All rights reserved.