public class SshPrivateKeyFileFactory
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static int |
OPENSSH_FORMAT |
static int |
OPENSSL_FORMAT |
| Constructor and Description |
|---|
SshPrivateKeyFileFactory() |
| Modifier and Type | Method and Description |
|---|---|
static void |
changePassphrase(java.io.File keyFile,
java.lang.String passphrase,
java.lang.String newPassphrase)
Take a file in any of the supported public key formats and convert to the
requested format.
|
static void |
convertFile(java.io.File keyFile,
java.lang.String passphrase,
int toFormat,
java.io.File toFile)
Take a file in any of the supported public key formats and convert to the
requested format.
|
static SshPrivateKeyFile |
create(SshKeyPair pair) |
static SshPrivateKeyFile |
create(SshKeyPair pair,
java.lang.String passphrase) |
static SshPrivateKeyFile |
create(SshKeyPair pair,
java.lang.String passphrase,
int format) |
static SshPrivateKeyFile |
create(SshKeyPair pair,
java.lang.String passphrase,
java.lang.String comment) |
static SshPrivateKeyFile |
create(SshKeyPair pair,
java.lang.String passphrase,
java.lang.String comment,
int format) |
static void |
createFile(SshKeyPair key,
java.lang.String passphrase,
java.io.File toFile) |
static void |
createFile(SshKeyPair key,
java.lang.String passphrase,
int format,
java.io.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(java.io.InputStream in)
Parse an InputStream and return a suitable SshPrivateKeyFile implementation.
|
public static final int OPENSSH_FORMAT
public static final int OPENSSL_FORMAT
public static SshPrivateKeyFile parse(byte[] formattedkey) throws java.io.IOException
formattedkey - java.io.IOExceptionpublic static SshPrivateKeyFile parse(java.io.InputStream in) throws java.io.IOException
in - java.io.IOExceptionpublic static SshPrivateKeyFile create(SshKeyPair pair) throws java.io.IOException
java.io.IOExceptionpublic static SshPrivateKeyFile create(SshKeyPair pair, java.lang.String passphrase) throws java.io.IOException
java.io.IOExceptionpublic static SshPrivateKeyFile create(SshKeyPair pair, java.lang.String passphrase, int format) throws java.io.IOException
java.io.IOExceptionpublic static SshPrivateKeyFile create(SshKeyPair pair, java.lang.String passphrase, java.lang.String comment) throws java.io.IOException
java.io.IOExceptionpublic static SshPrivateKeyFile create(SshKeyPair pair, java.lang.String passphrase, java.lang.String comment, int format) throws java.io.IOException
java.io.IOExceptionpublic static void createFile(SshKeyPair key, java.lang.String passphrase, java.io.File toFile) throws java.io.IOException
java.io.IOExceptionpublic static void createFile(SshKeyPair key, java.lang.String passphrase, int format, java.io.File toFile) throws java.io.IOException
key - comment - format - toFile - java.io.IOExceptionpublic static void convertFile(java.io.File keyFile,
java.lang.String passphrase,
int toFormat,
java.io.File toFile)
throws java.io.IOException,
InvalidPassphraseException
keyFile - toFormat - toFile - java.io.IOExceptionInvalidPassphraseExceptionpublic static void changePassphrase(java.io.File keyFile,
java.lang.String passphrase,
java.lang.String newPassphrase)
throws java.io.IOException,
InvalidPassphraseException
keyFile - toFormat - toFile - java.io.IOExceptionInvalidPassphraseExceptionCopyright © 2022. All rights reserved.