public class JCEComponentManager extends ComponentManager implements JCEAlgorithms
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());
CHACHA20, CHACHA20_POLY1305, ED25519, ED448, EdDSA, JCE_3DESCBCNOPADDING, JCE_3DESCTRNOPADDING, JCE_AESCBCNOPADDING, JCE_AESCTRNOPADDING, JCE_AESGCMNOPADDING, JCE_ARCFOUR, JCE_BLOWFISHCBCNOPADDING, JCE_DESCBCNOPADDING, JCE_DH, JCE_DH_KEY_AGREEMENT, JCE_DH_KEY_FACTORY, JCE_DH_KEY_GENERATOR, JCE_DSA, JCE_ECDH, JCE_HMACMD5, JCE_HMACRIPEMD160, JCE_HMACSHA1, JCE_HMACSHA256, JCE_HMACSHA512, JCE_MD5, JCE_MD5WithRSA, JCE_RSA, JCE_RSA_CIPHER, JCE_RSANONEPKCS1PADDING, JCE_SHA1, JCE_SHA1PRNG, JCE_SHA1WithDSA, JCE_SHA1WithECDSA, JCE_SHA1WithRSA, JCE_SHA256, JCE_SHA256WithECDSA, JCE_SHA256WithRSA, JCE_SHA384, JCE_SHA384WithECDSA, JCE_SHA512, JCE_SHA512WithECDSA, JCE_SHA512WithRSA, JCE_X509
Constructor and Description |
---|
JCEComponentManager() |
Modifier and Type | Method and Description |
---|---|
SshDsaPrivateKey |
createDsaPrivateKey(BigInteger p,
BigInteger q,
BigInteger g,
BigInteger x,
BigInteger y)
Create an instance of a DSA private key.
|
SshDsaPublicKey |
createDsaPublicKey()
Create an uninitialized instance of a DSA public key
|
SshDsaPublicKey |
createDsaPublicKey(BigInteger p,
BigInteger q,
BigInteger g,
BigInteger y)
Create an instance of a DSA public key.
|
SshRsaPrivateCrtKey |
createRsaPrivateCrtKey(BigInteger modulus,
BigInteger publicExponent,
BigInteger privateExponent,
BigInteger primeP,
BigInteger primeQ,
BigInteger crtCoefficient)
Create an instance of an RSA co-effecient private key.
|
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.
|
SshRsaPrivateKey |
createRsaPrivateKey(BigInteger modulus,
BigInteger privateExponent)
Create an instance of an RSA private key.
|
SshRsaPublicKey |
createRsaPublicKey(BigInteger modulus,
BigInteger publicExponent,
int version)
Create an instance of an RSA public key.
|
SshRsaPublicKey |
createSsh2RsaPublicKey()
Create an instance of an SSH2 RSA public key.
|
static void |
disableClientKex() |
static void |
disableServerKex() |
static void |
disableStartupTests() |
SshKeyPair |
generateDsaKeyPair(int bits)
Generate a new DSA public/private key pair.
|
SshKeyPair |
generateEcdsaKeyPair(int bits)
Generate a new ECDSA key pair.
|
SshKeyPair |
generateEd25519KeyPair() |
SshKeyPair |
generateEd448KeyPair() |
SshKeyPair |
generateRsaKeyPair(int bits,
int version)
Generate an RSA public/private pair.
|
static Provider |
getProviderForAlgorithm(String jceAlgorithm)
Get the provider for a specific algorithm.
|
SshSecureRandomGenerator |
getRND()
Get the secure random number generator.
|
static SecureRandom |
getSecureRandom()
Get the secure random implementation for the API.
|
static String |
getSecureRandomAlgorithm()
Get the algorithm used for secure random number generation.
|
static void |
initializeDefaultProvider(Provider provider)
Initialize the default JCE provider used by the API.
|
protected void |
initializeDigestFactory(ComponentFactory<Digest> digests)
Initialize the digest factory.
|
protected void |
initializeHmacFactory(ComponentFactory<SshHmac> hmacs)
Initialize the SSH2 HMAC factory.
|
protected void |
initializeKeyExchangeFactory(ComponentFactory<SshKeyExchange> clientKeyexchanges,
ComponentFactory<SshKeyExchange> serverKeyexchanges)
Initialize the SSH2 key exchange factory.
|
static void |
initializeProviderForAlgorithm(String jceAlgorithm,
Provider provider)
Initialize a provider for a specific algorithm.
|
protected void |
initializePublicKeyFactory(ComponentFactory<SshPublicKey> publickeys)
Initialize the public key factory.
|
protected void |
initializeSsh1CipherFactory(ComponentFactory<SshCipher> ciphers)
Initialize the SSH1 cipher factory.
|
protected void |
initializeSsh2CipherFactory(ComponentFactory<SshCipher> ciphers)
Initialize the SSH2 cipher factory.
|
SshKeyPair[] |
loadKeystore(File keystoreFile,
String alias,
String storePassphrase,
String keyPassphrase)
Load a host key from a keystore file.
|
SshKeyPair[] |
loadKeystore(File keystoreFile,
String alias,
String storePassphrase,
String keyPassphrase,
String storeType) |
SshKeyPair[] |
loadKeystore(InputStream in,
String alias,
String storePassphrase,
String keyPassphrase)
Load a keystore for use as an SSH host key.
|
SshKeyPair[] |
loadKeystore(InputStream in,
String alias,
String storePassphrase,
String keyPassphrase,
String storeType)
Load a keystore for use as an SSH host key.
|
static void |
setSecureRandomAlgorithm(String secureRandomAlgorithm)
Set the algorithm used for secure random number generation.
|
disableAlgorithm, enableAlgorithm, getInstance, getPerContextAlgorithmPreferences, getSecurityLevel, init, isDisabled, isEnableNoneCipher, isEnableNoneMac, reset, setEnableNoneCipher, setEnableNoneMac, setInstance, setMinimumSecurityLevel, setMinimumSecurityLevel, setPerContextAlgorithmPreferences, supportedDigests, supportedDigests, supportedHMacsCS, supportedHMacsCS, supportedHMacsSC, supportedHMacsSC, supportedKeyExchanges, supportedKeyExchanges, supportedPublicKeys, supportedPublicKeys, supportedSsh1CiphersCS, supportedSsh1CiphersCS, supportedSsh1CiphersSC, supportedSsh1CiphersSC, supportedSsh2CiphersCS, supportedSsh2CiphersCS, supportedSsh2CiphersSC, supportedSsh2CiphersSC
public static void disableStartupTests()
public static void disableServerKex()
public static void disableClientKex()
public static void initializeDefaultProvider(Provider provider)
provider
- public static void initializeProviderForAlgorithm(String jceAlgorithm, Provider provider)
jceAlgorithm
- provider
- public static String getSecureRandomAlgorithm()
public static void setSecureRandomAlgorithm(String secureRandomAlgorithm)
secureRandomAlgorithm
- public static Provider getProviderForAlgorithm(String jceAlgorithm)
jceAlgorithm
- public static SecureRandom getSecureRandom()
NoSuchAlgorithmException
public SshDsaPrivateKey createDsaPrivateKey(BigInteger p, BigInteger q, BigInteger g, BigInteger x, BigInteger y) throws SshException
ComponentManager
createDsaPrivateKey
in class ComponentManager
SshException
public SshDsaPublicKey createDsaPublicKey(BigInteger p, BigInteger q, BigInteger g, BigInteger y) throws SshException
ComponentManager
createDsaPublicKey
in class ComponentManager
SshException
public SshDsaPublicKey createDsaPublicKey()
ComponentManager
createDsaPublicKey
in class ComponentManager
public SshRsaPrivateCrtKey createRsaPrivateCrtKey(BigInteger modulus, BigInteger publicExponent, BigInteger privateExponent, BigInteger primeP, BigInteger primeQ, BigInteger crtCoefficient) throws SshException
ComponentManager
createRsaPrivateCrtKey
in class ComponentManager
SshException
public SshRsaPrivateCrtKey createRsaPrivateCrtKey(BigInteger modulus, BigInteger publicExponent, BigInteger privateExponent, BigInteger primeP, BigInteger primeQ, BigInteger primeExponentP, BigInteger primeExponentQ, BigInteger crtCoefficient) throws SshException
ComponentManager
createRsaPrivateCrtKey
in class ComponentManager
SshException
public SshRsaPrivateKey createRsaPrivateKey(BigInteger modulus, BigInteger privateExponent) throws SshException
ComponentManager
createRsaPrivateKey
in class ComponentManager
SshException
public SshRsaPublicKey createRsaPublicKey(BigInteger modulus, BigInteger publicExponent, int version) throws SshException
ComponentManager
createRsaPublicKey
in class ComponentManager
SshException
public SshRsaPublicKey createSsh2RsaPublicKey() throws SshException
ComponentManager
createSsh2RsaPublicKey
in class ComponentManager
SshException
public SshKeyPair generateDsaKeyPair(int bits) throws SshException
ComponentManager
generateDsaKeyPair
in class ComponentManager
SshException
public SshKeyPair generateRsaKeyPair(int bits, int version) throws SshException
ComponentManager
generateRsaKeyPair
in class ComponentManager
SshException
public SshKeyPair generateEcdsaKeyPair(int bits) throws SshException
ComponentManager
generateEcdsaKeyPair
in class ComponentManager
SshException
public SshSecureRandomGenerator getRND() throws SshException
ComponentManager
getRND
in class ComponentManager
SshException
protected void initializeDigestFactory(ComponentFactory<Digest> digests)
ComponentManager
initializeDigestFactory
in class ComponentManager
protected void initializeHmacFactory(ComponentFactory<SshHmac> hmacs)
ComponentManager
initializeHmacFactory
in class ComponentManager
protected void initializeKeyExchangeFactory(ComponentFactory<SshKeyExchange> clientKeyexchanges, ComponentFactory<SshKeyExchange> serverKeyexchanges)
ComponentManager
initializeKeyExchangeFactory
in class ComponentManager
protected void initializePublicKeyFactory(ComponentFactory<SshPublicKey> publickeys)
ComponentManager
initializePublicKeyFactory
in class ComponentManager
protected void initializeSsh1CipherFactory(ComponentFactory<SshCipher> ciphers)
ComponentManager
initializeSsh1CipherFactory
in class ComponentManager
protected void initializeSsh2CipherFactory(ComponentFactory<SshCipher> ciphers)
ComponentManager
initializeSsh2CipherFactory
in class ComponentManager
public SshKeyPair[] loadKeystore(InputStream in, String alias, String storePassphrase, String keyPassphrase) throws IOException
loadKeystore
in class ComponentManager
keystoreFile
- path to the keystore filealias
- the alias of the key in the keystorestorePassphrase
- the passphrase of the keystorekeyPassphrase
- the passphrase of the keyIOException
public SshKeyPair[] loadKeystore(InputStream in, String alias, String storePassphrase, String keyPassphrase, String storeType) throws IOException
loadKeystore
in class ComponentManager
keystoreFile
- path to the keystore filealias
- the alias of the key in the keystorestorePassphrase
- the passphrase of the keystorekeyPassphrase
- the passphrase of the keyIOException
public SshKeyPair[] loadKeystore(File keystoreFile, String alias, String storePassphrase, String keyPassphrase) throws IOException
ComponentManager
loadKeystore
in class ComponentManager
IOException
public SshKeyPair[] loadKeystore(File keystoreFile, String alias, String storePassphrase, String keyPassphrase, String storeType) throws IOException
loadKeystore
in class ComponentManager
IOException
public SshKeyPair generateEd25519KeyPair() throws SshException
generateEd25519KeyPair
in class ComponentManager
SshException
public SshKeyPair generateEd448KeyPair() throws SshException
generateEd448KeyPair
in class ComponentManager
SshException
Copyright © 2024. All rights reserved.