|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.maverick.sshd.components.ServerComponentManager
com.maverick.sshd.components.jce.JCEServerComponentManager
public class JCEServerComponentManager
A component manager for the Java runtime JCE provider. By default all algorithms will be selected from the default provider i.e no provider is specified in calls to JCE methods to create components. You can initialize a default provider to be used on all calls with the following code:
Alternatively you can also assign a specific provider for an individual algorithm, all algorithms used by the API are included as static constants in this class.JCEComponentManager.initializeDefaultProvider(new BouncyCastleProvider());
JCEComponentManager.initializeProviderForAlgorithm(JCEComponentManager.JCE_DSA, new BouncyCastleProvider());
| Field Summary |
|---|
| Fields inherited from interface com.maverick.ssh.components.jce.JCEAlgorithms |
|---|
JCE_AESCBCNOPADDING, JCE_AESCTRNOPADDING, JCE_BLOWFISHCBCNOPADDING, JCE_DESCBCNOPADDING, JCE_DH, JCE_DSA, JCE_HMACMD5, JCE_HMACSHA1, JCE_HMACSHA256, JCE_HMACSHA512, JCE_MD5, JCE_MD5WithRSA, JCE_RSA, JCE_RSANONEPKCS1PADDING, JCE_SHA1, JCE_SHA1PRNG, JCE_SHA1WithDSA, JCE_SHA1WithRSA, JCE_X509 |
| Constructor Summary | |
|---|---|
JCEServerComponentManager()
|
|
| Method Summary | |
|---|---|
SshDsaPrivateKey |
createDsaPrivateKey(java.math.BigInteger p,
java.math.BigInteger q,
java.math.BigInteger g,
java.math.BigInteger x,
java.math.BigInteger y)
Create a DSA private key from DSA parameters. |
SshDsaPublicKey |
createDsaPublicKey()
Create an uninitialized instance of a DSA public key. |
SshDsaPublicKey |
createDsaPublicKey(java.math.BigInteger p,
java.math.BigInteger q,
java.math.BigInteger g,
java.math.BigInteger y)
Create an instance of an DSA public key. |
SshRsaPrivateCrtKey |
createRsaPrivateCrtKey(java.math.BigInteger modulus,
java.math.BigInteger publicExponent,
java.math.BigInteger privateExponent,
java.math.BigInteger primeP,
java.math.BigInteger primeQ,
java.math.BigInteger crtCoefficient)
Create a RSA co-efficient key from RSA parameters. |
SshRsaPrivateCrtKey |
createRsaPrivateCrtKey(java.math.BigInteger modulus,
java.math.BigInteger publicExponent,
java.math.BigInteger privateExponent,
java.math.BigInteger primeP,
java.math.BigInteger primeQ,
java.math.BigInteger primeExponentP,
java.math.BigInteger primeExponentQ,
java.math.BigInteger crtCoefficient)
Create an RSA co-efficient key from RSA parameters. |
SshRsaPrivateKey |
createRsaPrivateKey(java.math.BigInteger modulus,
java.math.BigInteger privateExponent)
Create an RSA private key from RSA parameters |
SshRsaPublicKey |
createRsaPublicKey(java.math.BigInteger modulus,
java.math.BigInteger publicExponent,
int version)
Create an instance of an RSA public key from RSA parameters. |
SshRsaPublicKey |
createSsh2RsaPublicKey()
Create an uninitialized instance of an RSA public key |
SshKeyPair |
generateDsaKeyPair(int bits)
Generate a DSA key pair. |
SshKeyPair |
generateRsaKeyPair(int bits)
Generate an RSA key pair. |
static java.security.Provider |
getProviderForAlgorithm(java.lang.String jceAlgorithm)
Get the provider for a specific algorithm. |
SshSecureRandomGenerator |
getRND()
Get the secure number generator implementation. |
static java.security.SecureRandom |
getSecureRandom()
Get the secure random implementation for the API. |
static java.lang.String |
getSecureRandomAlgorithm()
Get the algorithm used for secure random number generation. |
static void |
initializeDefaultProvider(java.security.Provider provider)
Initialize the default JCE provider used by the API. |
protected void |
initializeDigestFactory(ComponentFactory digests)
Initialize the digest factory. |
protected void |
initializeHmacFactory(ComponentFactory hmacs)
Initialize the SSH2 HMac factory. |
protected void |
initializeKeyExchangeFactory(ComponentFactory keyexchange)
Initialize the key exchange factory. |
static void |
initializeProviderForAlgorithm(java.lang.String jceAlgorithm,
java.security.Provider provider)
Initialize a provider for a specific algorithm. |
protected void |
initializePublicKeyFactory(ComponentFactory publickeys)
Initialize the public key factory. |
protected void |
initializeSsh2CipherFactory(ComponentFactory ciphers)
Initialize the SSH2 cipher factory. |
void |
loadKeystore(java.io.File keystoreFile,
java.lang.String alias,
java.lang.String storePassphrase,
java.lang.String keyPassphrase,
SshContext context)
Load a host key from a keystore file. |
void |
loadKeystore(java.io.File keystoreFile,
java.lang.String alias,
java.lang.String storePassphrase,
java.lang.String keyPassphrase,
java.lang.String storeType,
SshContext context)
|
void |
loadKeystore(java.io.InputStream in,
java.lang.String alias,
java.lang.String storePassphrase,
java.lang.String keyPassphrase,
SshContext context)
Load a keystore for use as an SSH host key. |
void |
loadKeystore(java.io.InputStream in,
java.lang.String alias,
java.lang.String storePassphrase,
java.lang.String keyPassphrase,
java.lang.String storeType,
SshContext context)
Load a keystore for use as an SSH host key. |
static void |
setSecureRandomAlgorithm(java.lang.String secureRandomAlgorithm)
Set the algorithm used for secure random number generation. |
| Methods inherited from class com.maverick.sshd.components.ServerComponentManager |
|---|
getInstance, getPerContextAlgorithmPreferences, init, isEnableNoneCipher, setEnableNoneCipher, setInstance, setPerContextAlgorithmPreferences, supportedDigests, supportedHMacsCS, supportedHMacsSC, supportedKeyExchanges, supportedPublicKeys, supportedSsh2CiphersCS, supportedSsh2CiphersSC |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public JCEServerComponentManager()
| Method Detail |
|---|
public static void initializeDefaultProvider(java.security.Provider provider)
provider -
public static void initializeProviderForAlgorithm(java.lang.String jceAlgorithm,
java.security.Provider provider)
jceAlgorithm - provider - public static java.lang.String getSecureRandomAlgorithm()
public static void setSecureRandomAlgorithm(java.lang.String secureRandomAlgorithm)
secureRandomAlgorithm - public static java.security.Provider getProviderForAlgorithm(java.lang.String jceAlgorithm)
jceAlgorithm -
public static java.security.SecureRandom getSecureRandom()
throws java.security.NoSuchAlgorithmException
java.security.NoSuchAlgorithmException
public SshDsaPrivateKey createDsaPrivateKey(java.math.BigInteger p,
java.math.BigInteger q,
java.math.BigInteger g,
java.math.BigInteger x,
java.math.BigInteger y)
throws SshException
ServerComponentManager
createDsaPrivateKey in class ServerComponentManagerSshException
public SshDsaPublicKey createDsaPublicKey(java.math.BigInteger p,
java.math.BigInteger q,
java.math.BigInteger g,
java.math.BigInteger y)
throws SshException
ServerComponentManager
createDsaPublicKey in class ServerComponentManagerSshExceptionpublic SshDsaPublicKey createDsaPublicKey()
ServerComponentManager
createDsaPublicKey in class ServerComponentManager
public SshRsaPrivateCrtKey createRsaPrivateCrtKey(java.math.BigInteger modulus,
java.math.BigInteger publicExponent,
java.math.BigInteger privateExponent,
java.math.BigInteger primeP,
java.math.BigInteger primeQ,
java.math.BigInteger crtCoefficient)
throws SshException
ServerComponentManager
createRsaPrivateCrtKey in class ServerComponentManagerSshException
public SshRsaPrivateCrtKey createRsaPrivateCrtKey(java.math.BigInteger modulus,
java.math.BigInteger publicExponent,
java.math.BigInteger privateExponent,
java.math.BigInteger primeP,
java.math.BigInteger primeQ,
java.math.BigInteger primeExponentP,
java.math.BigInteger primeExponentQ,
java.math.BigInteger crtCoefficient)
throws SshException
ServerComponentManager
createRsaPrivateCrtKey in class ServerComponentManagerSshException
public SshRsaPrivateKey createRsaPrivateKey(java.math.BigInteger modulus,
java.math.BigInteger privateExponent)
throws SshException
ServerComponentManager
createRsaPrivateKey in class ServerComponentManagerSshException
public SshRsaPublicKey createRsaPublicKey(java.math.BigInteger modulus,
java.math.BigInteger publicExponent,
int version)
throws SshException
ServerComponentManager
createRsaPublicKey in class ServerComponentManagerSshException
public SshRsaPublicKey createSsh2RsaPublicKey()
throws SshException
ServerComponentManager
createSsh2RsaPublicKey in class ServerComponentManagerSshException
public SshKeyPair generateDsaKeyPair(int bits)
throws SshException
ServerComponentManager
generateDsaKeyPair in class ServerComponentManagerSshException
public SshKeyPair generateRsaKeyPair(int bits)
throws SshException
ServerComponentManager
generateRsaKeyPair in class ServerComponentManagerSshException
public SshSecureRandomGenerator getRND()
throws SshException
ServerComponentManager
getRND in class ServerComponentManagerSshExceptionprotected void initializeDigestFactory(ComponentFactory digests)
ServerComponentManager
initializeDigestFactory in class ServerComponentManagerprotected void initializeHmacFactory(ComponentFactory hmacs)
ServerComponentManager
initializeHmacFactory in class ServerComponentManagerprotected void initializeKeyExchangeFactory(ComponentFactory keyexchange)
ServerComponentManager
initializeKeyExchangeFactory in class ServerComponentManagerprotected void initializePublicKeyFactory(ComponentFactory publickeys)
ServerComponentManager
initializePublicKeyFactory in class ServerComponentManagerprotected void initializeSsh2CipherFactory(ComponentFactory ciphers)
ServerComponentManager
initializeSsh2CipherFactory in class ServerComponentManager
public void loadKeystore(java.io.InputStream in,
java.lang.String alias,
java.lang.String storePassphrase,
java.lang.String keyPassphrase,
SshContext context)
throws java.io.IOException
loadKeystore in class ServerComponentManagerkeystoreFile - path to the keystore filealias - the alias of the key in the keystorestorePassphrase - the passphrase of the keystorekeyPassphrase - the passphrase of the key
java.io.IOException
public void loadKeystore(java.io.InputStream in,
java.lang.String alias,
java.lang.String storePassphrase,
java.lang.String keyPassphrase,
java.lang.String storeType,
SshContext context)
throws java.io.IOException
loadKeystore in class ServerComponentManagerkeystoreFile - path to the keystore filealias - the alias of the key in the keystorestorePassphrase - the passphrase of the keystorekeyPassphrase - the passphrase of the key
java.io.IOException
public void loadKeystore(java.io.File keystoreFile,
java.lang.String alias,
java.lang.String storePassphrase,
java.lang.String keyPassphrase,
SshContext context)
throws java.io.IOException
ServerComponentManager
loadKeystore in class ServerComponentManagerjava.io.IOException
public void loadKeystore(java.io.File keystoreFile,
java.lang.String alias,
java.lang.String storePassphrase,
java.lang.String keyPassphrase,
java.lang.String storeType,
SshContext context)
throws java.io.IOException
loadKeystore in class ServerComponentManagerjava.io.IOException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||