public abstract class ComponentManager extends Object
An abstract class that manages the components used by the SSH API. All
algorithm implementations are obtained through a single provider. One
implementation is provided the
JCEComponentManager
that uses the
Java runtime JCE provider(s) algorithm implementations.
Constructor and Description |
---|
ComponentManager() |
Modifier and Type | Method and Description |
---|---|
abstract SshDsaPrivateKey |
createDsaPrivateKey(BigInteger p,
BigInteger q,
BigInteger g,
BigInteger x,
BigInteger y)
Create an instance of a DSA private key.
|
abstract SshDsaPublicKey |
createDsaPublicKey()
Create an uninitialized instance of a DSA public key
|
abstract SshDsaPublicKey |
createDsaPublicKey(BigInteger p,
BigInteger q,
BigInteger g,
BigInteger y)
Create an instance of a DSA public key.
|
abstract SshRsaPrivateCrtKey |
createRsaPrivateCrtKey(BigInteger modulus,
BigInteger publicExponent,
BigInteger privateExponent,
BigInteger primeP,
BigInteger primeQ,
BigInteger crtCoefficient)
Create an instance of an RSA co-effecient private key.
|
abstract SshRsaPrivateCrtKey |
createRsaPrivateCrtKey(BigInteger modulus,
BigInteger publicExponent,
BigInteger privateExponent,
BigInteger primeP,
BigInteger primeQ,
BigInteger primeExponentP,
BigInteger primeExponentQ,
BigInteger crtCoefficient)
Create an instance of an RSA co-efficent private key.
|
abstract SshRsaPrivateKey |
createRsaPrivateKey(BigInteger modulus,
BigInteger privateExponent)
Create an instance of an RSA private key.
|
abstract SshRsaPublicKey |
createRsaPublicKey(BigInteger modulus,
BigInteger publicExponent)
Create an instance of an RSA public key.
|
abstract SshRsaPublicKey |
createSsh2RsaPublicKey()
Create an instance of an SSH2 RSA public key.
|
abstract SshKeyPair |
generateDsaKeyPair(int bits)
Generate a new DSA public/private key pair.
|
abstract SshKeyPair |
generateRsaKeyPair(int bits)
Generate an RSA public/private pair.
|
static ComponentManager |
getInstance()
Get the installed component manager.
|
static boolean |
getPerContextAlgorithmPreferences() |
abstract SshSecureRandomGenerator |
getRND()
Get the secure random number generator.
|
protected void |
init() |
protected abstract void |
initializeDigestFactory(ComponentFactory digests)
Initialize the digest factory.
|
protected abstract void |
initializeHmacFactory(ComponentFactory hmacs)
Initialize the SSH2 HMAC factory.
|
protected abstract void |
initializeKeyExchangeFactory(ComponentFactory keyexchange)
Initialize the SSH2 key exchange factory.
|
protected abstract void |
initializePublicKeyFactory(ComponentFactory publickeys)
Initialize the public key factory.
|
protected abstract void |
initializeSsh2CipherFactory(ComponentFactory ciphers)
Initialize the SSH2 cipher factory.
|
static boolean |
isEnableNoneCipher() |
static boolean |
isEnableNoneMac() |
static void |
setEnableNoneCipher(boolean enableNoneCipher) |
static void |
setEnableNoneMac(boolean enableNoneCipher) |
static void |
setInstance(ComponentManager instance)
Overide the installed component manager with an alternative
implementation.
|
static void |
setPerContextAlgorithmPreferences(boolean enable) |
ComponentFactory |
supportedDigests()
The supported digests
|
ComponentFactory |
supportedHMacsCS()
The supported SSH2 Hmacs.
|
ComponentFactory |
supportedHMacsSC()
The supported SSH2 Hmacs.
|
ComponentFactory |
supportedKeyExchanges()
The supported SSH2 key exchanges.
|
ComponentFactory |
supportedPublicKeys()
The supported public keys
|
ComponentFactory |
supportedSsh2CiphersCS()
The supported SSH2 ciphers.
|
ComponentFactory |
supportedSsh2CiphersSC()
The supported SSH2 ciphers.
|
public static boolean isEnableNoneCipher()
public static void setEnableNoneCipher(boolean enableNoneCipher)
public static boolean isEnableNoneMac()
public static void setEnableNoneMac(boolean enableNoneCipher)
public static void setPerContextAlgorithmPreferences(boolean enable)
public static boolean getPerContextAlgorithmPreferences()
public static ComponentManager getInstance()
protected void init() throws SshException
SshException
protected abstract void initializeSsh2CipherFactory(ComponentFactory ciphers)
ciphers
- protected abstract void initializeHmacFactory(ComponentFactory hmacs)
hmacs
- protected abstract void initializePublicKeyFactory(ComponentFactory publickeys)
publickeys
- protected abstract void initializeKeyExchangeFactory(ComponentFactory keyexchange)
keyexchange
- protected abstract void initializeDigestFactory(ComponentFactory digests)
digests
- public static void setInstance(ComponentManager instance)
instance
- public ComponentFactory supportedSsh2CiphersSC()
public ComponentFactory supportedSsh2CiphersCS()
public ComponentFactory supportedHMacsSC()
public ComponentFactory supportedHMacsCS()
public ComponentFactory supportedKeyExchanges()
public ComponentFactory supportedPublicKeys()
public ComponentFactory supportedDigests()
public abstract SshKeyPair generateRsaKeyPair(int bits) throws SshException
bits
- version
- SshException
public abstract SshRsaPublicKey createRsaPublicKey(BigInteger modulus, BigInteger publicExponent) throws SshException
modulus
- publicExponent
- version
- SshException
public abstract SshRsaPublicKey createSsh2RsaPublicKey() throws SshException
SshException
public abstract SshRsaPrivateKey createRsaPrivateKey(BigInteger modulus, BigInteger privateExponent) throws SshException
modulus
- privateExponent
- SshException
public abstract SshRsaPrivateCrtKey createRsaPrivateCrtKey(BigInteger modulus, BigInteger publicExponent, BigInteger privateExponent, BigInteger primeP, BigInteger primeQ, BigInteger crtCoefficient) throws SshException
modulus
- publicExponent
- privateExponent
- primeP
- primeQ
- crtCoefficient
- SshException
public abstract SshRsaPrivateCrtKey createRsaPrivateCrtKey(BigInteger modulus, BigInteger publicExponent, BigInteger privateExponent, BigInteger primeP, BigInteger primeQ, BigInteger primeExponentP, BigInteger primeExponentQ, BigInteger crtCoefficient) throws SshException
modulus
- publicExponent
- privateExponent
- primeP
- primeQ
- primeExponentP
- primeExponentQ
- crtCoefficient
- SshException
public abstract SshKeyPair generateDsaKeyPair(int bits) throws SshException
bits
- SshException
public abstract SshDsaPublicKey createDsaPublicKey(BigInteger p, BigInteger q, BigInteger g, BigInteger y) throws SshException
p
- q
- g
- y
- SshException
public abstract SshDsaPublicKey createDsaPublicKey()
public abstract SshDsaPrivateKey createDsaPrivateKey(BigInteger p, BigInteger q, BigInteger g, BigInteger x, BigInteger y) throws SshException
p
- q
- g
- x
- y
- SshException
public abstract SshSecureRandomGenerator getRND() throws SshException
SshException
Copyright © 2014. All rights reserved.