public class MaverickIdentityManager extends java.lang.Object implements SshIdentityManager
SshIdentityManager, used for managing
private keys used for authentication.| Constructor and Description |
|---|
MaverickIdentityManager() |
| Modifier and Type | Method and Description |
|---|---|
SshPrivateKeyFile |
create(SshKeyPair pair,
int format,
char[] passphrase,
java.lang.String comment)
Create a
SshPrivateKeyFile that will allow you obtain a formatted
version of a SshPrivateKey for storage. |
SshPublicKeyFile |
create(SshPublicKey key,
java.lang.String options,
java.lang.String comment,
int format)
Create a Public Key File that may be used to write authorized_keys files
or other public key storage systems.
|
SshPrivateKeyFile |
createPrivateKeyFromStream(java.io.InputStream in)
Parse a stream that provides a private key in some supported format.
|
SshPublicKeyFile |
createPublicKeyFromStream(java.io.InputStream in)
Parse a stream that provides a public key in some supported format.
|
SshKeyPair |
generateKeyPair(java.lang.String keyType,
int keyBits)
Generate a new key pair.
|
java.util.List |
getSupportedKeyLengths()
Get a list of all the supported key lengths.
|
java.util.List |
getSupportedKeyTypes()
Get a list of all the supported key types.
|
java.util.List |
getSupportedPrivateKeyFileFormats()
Get a list of all the supported private key file formats that may be
created.
|
java.util.List |
getSupportedPublicKeyFileFormats()
Get a list of all the supported public key file formats that may be
created.
|
public SshPrivateKeyFile createPrivateKeyFromStream(java.io.InputStream in) throws SshException
SshIdentityManagerSshPrivateKeyFile so may
then be persisted elsewhere if you wish, or you can just obtain the
SshPrivateKeyFile.createPrivateKeyFromStream in interface SshIdentityManagerin - stream to read key fromSshException - if the raw data cannot be parsed into a private keypublic SshPublicKeyFile createPublicKeyFromStream(java.io.InputStream in) throws SshException
SshIdentityManagerSshPublicKeyFile so may
then be persisted elsewhere if you wish, or you can just obtain the
SshPublicKey.createPublicKeyFromStream in interface SshIdentityManagerin - stream to read key fromSshException - if the raw data cannot be parsed into a public keypublic SshPrivateKeyFile create(SshKeyPair pair, int format, char[] passphrase, java.lang.String comment) throws SshException
SshIdentityManagerSshPrivateKeyFile that will allow you obtain a formatted
version of a SshPrivateKey for storage. The public key is
required for this, so SshKeyPair containing the private key is
required. See SshPrivateKeyFile for possible format codes.
Note, not all key formats support the optional comment field.
create in interface SshIdentityManagerpair - key pairformat - formatpassphrase - passphrase if you want the key encrypted, null if notcomment - comment if supported by formatSshExceptionpublic SshKeyPair generateKeyPair(java.lang.String keyType, int keyBits) throws SshException
SshIdentityManagerSshProvider.seed(long).generateKeyPair in interface SshIdentityManagerkeyType - key type.keyBits - key lengthSshException - if pair cannot be generated.public java.util.List getSupportedKeyLengths()
SshIdentityManagerInteger whose value is the key size in bits.getSupportedKeyLengths in interface SshIdentityManagerpublic java.util.List getSupportedPublicKeyFileFormats()
SshIdentityManagerInteger whose value
corresponds to one of the format codes in SshPublicKeyFilegetSupportedPublicKeyFileFormats in interface SshIdentityManagerSshPublicKeyFilepublic java.util.List getSupportedPrivateKeyFileFormats()
SshIdentityManagerInteger whose value
corresponds to one of the format codes in SshPrivateKeyFilegetSupportedPrivateKeyFileFormats in interface SshIdentityManagerSshPublicKeyFilepublic java.util.List getSupportedKeyTypes()
SshIdentityManagerString which will be one of
SshConfiguration.PUBLIC_KEY_SSHDSA,
SshConfiguration.PUBLIC_KEY_SSHRSA or
SshConfiguration.PUBLIC_KEY_SSHDSA.getSupportedKeyTypes in interface SshIdentityManagerpublic SshPublicKeyFile create(SshPublicKey key, java.lang.String options, java.lang.String comment, int format) throws SshException
SshIdentityManagercreate in interface SshIdentityManagerkey - public key to useoptions - additional options when supported by the formatcomment - comment when supported by the formatformat - key format. See SshPublicKeyFile for format types.SshException - if public key file may not be createdCopyright © 2018. All rights reserved.