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
concrete 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,
int version)
Create an instance of an RSA public key.
|
abstract SshRsaPublicKey |
createSsh2RsaPublicKey()
Create an instance of an SSH2 RSA public key.
|
void |
disableAlgorithm(String algorithm) |
void |
enableAlgorithm(String algorithm) |
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 |
generateEd448KeyPair() |
abstract SshKeyPair |
generateRsaKeyPair(int bits,
int version)
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.
|
SecurityLevel |
getSecurityLevel() |
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 |
initializeKeyExchangeFactory(ComponentFactory<SshKeyExchange> clientKeyexchanges,
ComponentFactory<SshKeyExchange> serverKeyexchanges)
Initialize the SSH2 key exchange factory.
|
protected abstract void |
initializePublicKeyFactory(ComponentFactory<SshPublicKey> publickeys)
Initialize the public key factory.
|
protected abstract void |
initializeSsh1CipherFactory(ComponentFactory<SshCipher> ciphers)
Initialize the SSH1 cipher factory.
|
protected abstract void |
initializeSsh2CipherFactory(ComponentFactory<SshCipher> ciphers)
Initialize the SSH2 cipher factory.
|
boolean |
isDisabled(String algorithm) |
static boolean |
isEnableNoneCipher() |
static boolean |
isEnableNoneMac() |
abstract SshKeyPair[] |
loadKeystore(File keystoreFile,
String alias,
String storePassphrase,
String keyPassphrase)
Load a host key from a keystore file.
|
abstract SshKeyPair[] |
loadKeystore(File keystoreFile,
String alias,
String storePassphrase,
String keyPassphrase,
String storeType) |
abstract SshKeyPair[] |
loadKeystore(InputStream in,
String alias,
String storePassphrase,
String keyPassphrase)
Load a host key from a keystore InputStream.
|
abstract SshKeyPair[] |
loadKeystore(InputStream in,
String alias,
String storePassphrase,
String keyPassphrase,
String storeType) |
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) |
void |
setMinimumSecurityLevel(SecurityLevel securityLevel,
boolean managedSecurity) |
static void |
setPerContextAlgorithmPreferences(boolean enable)
Deprecated.
All contexts now have a copy of the algorithm preferences and require
separate configuration. Disabling this feature will cause problems especially in the
case where client and server use the same JVM.
|
ComponentFactory<Digest> |
supportedDigests()
Deprecated.
Preferences should be configured on Ssh2Context or SshContext objects and not directly on the ComponentManager.
|
ComponentFactory<Digest> |
supportedDigests(boolean clone)
Deprecated.
Preferences should be configured on Ssh2Context or SshContext objects and not directly on the ComponentManager.
|
ComponentFactory<SshHmac> |
supportedHMacsCS()
Deprecated.
Preferences should be configured on Ssh2Context or SshContext objects and not directly on the ComponentManager.
|
ComponentFactory<SshHmac> |
supportedHMacsCS(boolean clone)
Deprecated.
Preferences should be configured on Ssh2Context or SshContext objects and not directly on the ComponentManager.
|
ComponentFactory<SshHmac> |
supportedHMacsSC()
Deprecated.
Preferences should be configured on Ssh2Context or SshContext objects and not directly on the ComponentManager.
|
ComponentFactory<SshHmac> |
supportedHMacsSC(boolean clone)
Deprecated.
Preferences should be configured on Ssh2Context or SshContext objects and not directly on the ComponentManager.
|
ComponentFactory<SshKeyExchange> |
supportedKeyExchanges(boolean serverMode)
Deprecated.
Preferences should be configured on Ssh2Context or SshContext objects and not directly on the ComponentManager.
|
ComponentFactory<SshKeyExchange> |
supportedKeyExchanges(boolean serverMode,
boolean clone)
Deprecated.
Preferences should be configured on Ssh2Context or SshContext objects and not directly on the ComponentManager.
|
ComponentFactory<SshPublicKey> |
supportedPublicKeys()
Deprecated.
Preferences should be configured on Ssh2Context or SshContext objects and not directly on the ComponentManager.
|
ComponentFactory<SshPublicKey> |
supportedPublicKeys(boolean clone)
Deprecated.
Preferences should be configured on Ssh2Context or SshContext objects and not directly on the ComponentManager.
|
ComponentFactory<SshCipher> |
supportedSsh1CiphersCS()
Deprecated.
SSH1 will be removed in the next major release
|
ComponentFactory<SshCipher> |
supportedSsh1CiphersCS(boolean clone)
Deprecated.
SSH1 will be removed in the next major release
|
ComponentFactory<SshCipher> |
supportedSsh1CiphersSC()
Deprecated.
SSH1 will be removed in the next major release
|
ComponentFactory<SshCipher> |
supportedSsh1CiphersSC(boolean clone)
Deprecated.
SSH1 will be removed in the next major release
|
ComponentFactory<SshCipher> |
supportedSsh2CiphersCS()
Deprecated.
Preferences should be configured on Ssh2Context or SshContext objects and not directly on the ComponentManager.
|
ComponentFactory<SshCipher> |
supportedSsh2CiphersCS(boolean clone)
Deprecated.
Preferences should be configured on Ssh2Context or SshContext objects and not directly on the ComponentManager.
|
ComponentFactory<SshCipher> |
supportedSsh2CiphersSC()
Deprecated.
Preferences should be configured on Ssh2Context or SshContext objects and not directly on the ComponentManager.
|
ComponentFactory<SshCipher> |
supportedSsh2CiphersSC(boolean clone)
Deprecated.
Preferences should be configured on Ssh2Context or SshContext objects and not directly on the ComponentManager.
|
public void disableAlgorithm(String algorithm)
public boolean isDisabled(String algorithm)
public void enableAlgorithm(String algorithm)
public static boolean isEnableNoneCipher()
public static void setEnableNoneCipher(boolean enableNoneCipher)
public static boolean isEnableNoneMac()
public static void setEnableNoneMac(boolean enableNoneCipher)
@Deprecated public static void setPerContextAlgorithmPreferences(boolean enable)
enable
- public static boolean getPerContextAlgorithmPreferences()
public static ComponentManager getInstance()
public static void reset()
protected void init() throws SshException
SshException
protected abstract void initializeSsh1CipherFactory(ComponentFactory<SshCipher> ciphers)
ciphers
- protected 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 initializeKeyExchangeFactory(ComponentFactory<SshKeyExchange> clientKeyexchanges, ComponentFactory<SshKeyExchange> serverKeyexchanges)
keyexchange
- protected abstract void initializeDigestFactory(ComponentFactory<Digest> digests)
digests
- public static void setInstance(ComponentManager instance)
instance
- @Deprecated public ComponentFactory<SshCipher> supportedSsh1CiphersSC(boolean clone)
@Deprecated public ComponentFactory<SshCipher> supportedSsh1CiphersSC()
@Deprecated public ComponentFactory<SshCipher> supportedSsh1CiphersCS(boolean clone)
@Deprecated public ComponentFactory<SshCipher> supportedSsh1CiphersCS()
@Deprecated public ComponentFactory<SshCipher> supportedSsh2CiphersSC(boolean clone)
@Deprecated public ComponentFactory<SshCipher> supportedSsh2CiphersSC()
@Deprecated public ComponentFactory<SshCipher> supportedSsh2CiphersCS(boolean clone)
@Deprecated public ComponentFactory<SshCipher> supportedSsh2CiphersCS()
@Deprecated public ComponentFactory<SshHmac> supportedHMacsSC(boolean clone)
@Deprecated public ComponentFactory<SshHmac> supportedHMacsSC()
@Deprecated public ComponentFactory<SshHmac> supportedHMacsCS(boolean clone)
@Deprecated public ComponentFactory<SshHmac> supportedHMacsCS()
@Deprecated public ComponentFactory<SshKeyExchange> supportedKeyExchanges(boolean serverMode, boolean clone)
@Deprecated public ComponentFactory<SshKeyExchange> supportedKeyExchanges(boolean serverMode)
@Deprecated public ComponentFactory<SshPublicKey> supportedPublicKeys(boolean clone)
@Deprecated public ComponentFactory<SshPublicKey> supportedPublicKeys()
@Deprecated public ComponentFactory<Digest> supportedDigests(boolean clone)
@Deprecated public ComponentFactory<Digest> supportedDigests()
public abstract SshKeyPair generateRsaKeyPair(int bits, int version) throws SshException
bits
- version
- SshException
public abstract SshKeyPair generateEcdsaKeyPair(int bits) throws SshException
bits
- SshException
public abstract SshRsaPublicKey createRsaPublicKey(BigInteger modulus, BigInteger publicExponent, int version) 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
public abstract SshKeyPair[] loadKeystore(File keystoreFile, String alias, String storePassphrase, String keyPassphrase) throws IOException
keystoreFile
- alias
- storePassphrase
- keyPassphrase
- IOException
public abstract SshKeyPair[] loadKeystore(InputStream in, String alias, String storePassphrase, String keyPassphrase) throws IOException
in
- alias
- storePassphrase
- keyPassphrase
- IOException
public abstract SshKeyPair[] loadKeystore(File keystoreFile, String alias, String storePassphrase, String keyPassphrase, String storeType) throws IOException
IOException
public abstract SshKeyPair[] loadKeystore(InputStream in, String alias, String storePassphrase, String keyPassphrase, String storeType) throws IOException
IOException
public abstract SshKeyPair generateEd25519KeyPair() throws SshException
SshException
public abstract SshKeyPair generateEd448KeyPair() throws SshException
SshException
public void setMinimumSecurityLevel(SecurityLevel securityLevel) throws SshException
SshException
public void setMinimumSecurityLevel(SecurityLevel securityLevel, boolean managedSecurity) throws SshException
SshException
public SecurityLevel getSecurityLevel()
Copyright © 2024. All rights reserved.