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
- IOException
public static SshPrivateKeyFile parse(InputStream in) throws IOException
in
- IOException
public static SshPrivateKeyFile create(SshKeyPair pair, String passphrase, String comment, int format) throws IOException
IOException
public static void createFile(SshKeyPair key, String passphrase, String comment, int format, File toFile) throws IOException
key
- comment
- format
- toFile
- IOException
public static void convertFile(File keyFile, String passphrase, String comment, int toFormat, File toFile) throws IOException, InvalidPassphraseException
keyFile
- toFormat
- toFile
- IOException
InvalidPassphraseException
public static void changePassphrase(File keyFile, String passphrase, String newPassphrase) throws IOException, InvalidPassphraseException
keyFile
- toFormat
- toFile
- IOException
InvalidPassphraseException
Copyright © 2024. All rights reserved.