public class SshPrivateKeyFileFactory extends Object
| Modifier and Type | Field and Description |
|---|---|
static int |
OPENSSH_FORMAT |
static int |
OPENSSL_FORMAT |
static int |
SSH1_FORMAT
Deprecated.
|
static int |
SSHTOOLS_FORMAT
Deprecated.
|
| Constructor and Description |
|---|
SshPrivateKeyFileFactory() |
| Modifier and Type | Method and Description |
|---|---|
static void |
changePassphrase(File keyFile,
String passphrase,
String newPassphrase)
Take a file in any of the supported public key formats and convert to the
requested format.
|
static void |
convertFile(File keyFile,
String passphrase,
String comment,
int toFormat,
File toFile)
Take a file in any of the supported public key formats and convert to the
requested format.
|
static SshPrivateKeyFile |
create(SshKeyPair pair,
String passphrase,
String comment,
int format) |
static void |
createFile(SshKeyPair key,
String passphrase,
String comment,
int format,
File toFile)
Take a SshPrivateKey and write it to a
file.
|
static SshPrivateKeyFile |
parse(byte[] formattedkey)
Parse formatted data and return a suitable SshPrivateKeyFile implementation.
|
static SshPrivateKeyFile |
parse(InputStream in)
Parse an InputStream and return a suitable SshPrivateKeyFile implementation.
|
public static final int OPENSSH_FORMAT
public static final int OPENSSL_FORMAT
@Deprecated public static final int SSHTOOLS_FORMAT
@Deprecated public static final int SSH1_FORMAT
public static SshPrivateKeyFile parse(byte[] formattedkey) throws IOException
formattedkey - IOExceptionpublic static SshPrivateKeyFile parse(InputStream in) throws IOException
in - IOExceptionpublic static SshPrivateKeyFile create(SshKeyPair pair, String passphrase, String comment, int format) throws IOException
IOExceptionpublic static void createFile(SshKeyPair key, String passphrase, String comment, int format, File toFile) throws IOException
key - comment - format - toFile - IOExceptionpublic static void convertFile(File keyFile, String passphrase, String comment, int toFormat, File toFile) throws IOException, InvalidPassphraseException
keyFile - toFormat - toFile - IOExceptionInvalidPassphraseExceptionpublic static void changePassphrase(File keyFile, String passphrase, String newPassphrase) throws IOException, InvalidPassphraseException
keyFile - toFormat - toFile - IOExceptionInvalidPassphraseExceptionCopyright © 2025. All rights reserved.