public abstract class ComponentManager
extends java.lang.Object
An abstract class that manages the components used by the SSH API. All
algorithm implementations are obtained through a single provider. One
concrete implementation is provided, the
JCEComponentManager that uses the
Java runtime JCE provider(s) algorithm implementations.
| Modifier and Type | Field and Description |
|---|---|
protected static boolean |
enableCbc |
protected static ComponentManager |
instance |
| Modifier | Constructor and Description |
|---|---|
protected |
ComponentManager() |
| Modifier and Type | Method and Description |
|---|---|
abstract SshDsaPrivateKey |
createDsaPrivateKey(java.math.BigInteger p,
java.math.BigInteger q,
java.math.BigInteger g,
java.math.BigInteger x,
java.math.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(java.math.BigInteger p,
java.math.BigInteger q,
java.math.BigInteger g,
java.math.BigInteger y)
Create an instance of a DSA public key.
|
abstract 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 an instance of an RSA co-effecient private key.
|
abstract 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 instance of an RSA co-efficent private key.
|
abstract SshRsaPrivateKey |
createRsaPrivateKey(java.math.BigInteger modulus,
java.math.BigInteger privateExponent)
Create an instance of an RSA private key.
|
abstract SshRsaPublicKey |
createRsaPublicKey(java.math.BigInteger modulus,
java.math.BigInteger publicExponent)
Create an instance of an RSA public key.
|
abstract SshRsaPublicKey |
createSsh2RsaPublicKey()
Create an instance of an SSH2 RSA public key.
|
void |
disableAlgorithm(java.lang.String algorithm) |
static void |
disableCBCCiphers() |
void |
enableAlgorithm(java.lang.String algorithm) |
static void |
enableCBCCiphers() |
abstract SshKeyPair |
generateDsaKeyPair(int bits)
Generate a new DSA public/private key pair.
|
abstract SshKeyPair |
generateEcdsaKeyPair(int bits)
Generate a new ECDSA key pair.
|
abstract SshKeyPair |
generateEd25519KeyPair() |
abstract SshKeyPair |
generateRsaKeyPair(int bits,
int version)
Generate an RSA public/private pair.
|
static ComponentManager |
getDefaultInstance() |
Digest |
getDigest(java.lang.String name) |
static ComponentManager |
getInstance()
Get the installed component manager.
|
abstract SshSecureRandomGenerator |
getRND()
Get the secure random number generator.
|
protected void |
init() |
protected abstract void |
initializeDigestFactory(ComponentFactory<Digest> digests)
Initialize the digest factory.
|
protected abstract void |
initializeHmacFactory(ComponentFactory<SshHmac> hmacs)
Initialize the SSH2 HMAC factory.
|
protected abstract void |
initializePublicKeyFactory(ComponentFactory<SshPublicKey> publickeys)
Initialize the public key factory.
|
protected abstract void |
initializeSsh2CipherFactory(ComponentFactory<SshCipher> ciphers)
Initialize the SSH2 cipher factory.
|
boolean |
isDisabled(java.lang.String algorithm) |
static boolean |
isEnableNoneCipher() |
static boolean |
isEnableNoneMac() |
<T> void |
loadExternalComponents(java.lang.String componentFile,
ComponentFactory<T> componentFactory) |
static void |
reset() |
static void |
setEnableNoneCipher(boolean enableNoneCipher) |
static void |
setEnableNoneMac(boolean enableNoneCipher) |
static void |
setInstance(ComponentManager instance)
Overide the installed component manager with an alternative
implementation.
|
void |
setMinimumSecurityLevel(SecurityLevel securityLevel) |
ComponentFactory<Digest> |
supportedDigests()
The supported digests
|
ComponentFactory<SshHmac> |
supportedHMacsCS()
The supported SSH2 Hmacs.
|
ComponentFactory<SshHmac> |
supportedHMacsSC()
The supported SSH2 Hmacs.
|
ComponentFactory<SshPublicKey> |
supportedPublicKeys()
The supported public keys
|
ComponentFactory<SshCipher> |
supportedSsh1CiphersCS()
The supported SSH1 ciphers.
|
ComponentFactory<SshCipher> |
supportedSsh1CiphersSC()
The supported SSH1 ciphers.
|
ComponentFactory<SshCipher> |
supportedSsh2CiphersCS()
The supported SSH2 ciphers.
|
ComponentFactory<SshCipher> |
supportedSsh2CiphersSC()
The supported SSH2 ciphers.
|
protected static boolean enableCbc
protected static ComponentManager instance
public void disableAlgorithm(java.lang.String algorithm)
public boolean isDisabled(java.lang.String algorithm)
public void enableAlgorithm(java.lang.String algorithm)
public static boolean isEnableNoneCipher()
public static void setEnableNoneCipher(boolean enableNoneCipher)
public static boolean isEnableNoneMac()
public static void setEnableNoneMac(boolean enableNoneCipher)
public static void enableCBCCiphers()
public static void disableCBCCiphers()
public static ComponentManager getInstance()
public static ComponentManager getDefaultInstance()
public static void reset()
protected void init()
throws SshException
SshExceptionprotected abstract void initializeSsh2CipherFactory(ComponentFactory<SshCipher> ciphers)
ciphers - protected abstract void initializeHmacFactory(ComponentFactory<SshHmac> hmacs)
hmacs - protected abstract void initializePublicKeyFactory(ComponentFactory<SshPublicKey> publickeys)
publickeys - protected abstract void initializeDigestFactory(ComponentFactory<Digest> digests)
digests - public static void setInstance(ComponentManager instance)
instance - public ComponentFactory<SshCipher> supportedSsh1CiphersSC()
public ComponentFactory<SshCipher> supportedSsh1CiphersCS()
public ComponentFactory<SshCipher> supportedSsh2CiphersSC()
public ComponentFactory<SshCipher> supportedSsh2CiphersCS()
public ComponentFactory<SshHmac> supportedHMacsSC()
public ComponentFactory<SshHmac> supportedHMacsCS()
public ComponentFactory<SshPublicKey> supportedPublicKeys()
public ComponentFactory<Digest> supportedDigests()
public abstract SshKeyPair generateRsaKeyPair(int bits, int version) throws SshException
bits - version - SshExceptionpublic abstract SshKeyPair generateEcdsaKeyPair(int bits) throws SshException
bits - SshExceptionpublic abstract SshKeyPair generateEd25519KeyPair() throws SshException
SshExceptionpublic abstract SshRsaPublicKey createRsaPublicKey(java.math.BigInteger modulus, java.math.BigInteger publicExponent) throws SshException
modulus - publicExponent - version - SshExceptionpublic abstract SshRsaPublicKey createSsh2RsaPublicKey() throws SshException
SshExceptionpublic abstract SshRsaPrivateKey createRsaPrivateKey(java.math.BigInteger modulus, java.math.BigInteger privateExponent) throws SshException
modulus - privateExponent - SshExceptionpublic abstract 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
modulus - publicExponent - privateExponent - primeP - primeQ - crtCoefficient - SshExceptionpublic abstract 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
modulus - publicExponent - privateExponent - primeP - primeQ - primeExponentP - primeExponentQ - crtCoefficient - SshExceptionpublic abstract SshKeyPair generateDsaKeyPair(int bits) throws SshException
bits - SshExceptionpublic abstract SshDsaPublicKey createDsaPublicKey(java.math.BigInteger p, java.math.BigInteger q, java.math.BigInteger g, java.math.BigInteger y) throws SshException
p - q - g - y - SshExceptionpublic abstract SshDsaPublicKey createDsaPublicKey()
public abstract SshDsaPrivateKey createDsaPrivateKey(java.math.BigInteger p, java.math.BigInteger q, java.math.BigInteger g, java.math.BigInteger x, java.math.BigInteger y) throws SshException
p - q - g - x - y - SshExceptionpublic abstract SshSecureRandomGenerator getRND() throws SshException
SshExceptionpublic Digest getDigest(java.lang.String name) throws SshException
SshExceptionpublic <T> void loadExternalComponents(java.lang.String componentFile,
ComponentFactory<T> componentFactory)
public void setMinimumSecurityLevel(SecurityLevel securityLevel) throws SshException
SshExceptionCopyright © 2022. All rights reserved.