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());
JCE_3DESCBCNOPADDING, JCE_3DESCTRNOPADDING, JCE_AESCBCNOPADDING, JCE_AESCTRNOPADDING, JCE_ARCFOUR, 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_SHA256, 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)
Create an instance of an RSA public key.
|
SshRsaPublicKey |
createSsh2RsaPublicKey()
Create an instance of an SSH2 RSA public key.
|
SshKeyPair |
generateDsaKeyPair(int bits)
Generate a new DSA public/private key pair.
|
SshKeyPair |
generateRsaKeyPair(int bits)
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 digests)
Initialize the digest factory.
|
protected void |
initializeHmacFactory(ComponentFactory hmacs)
Initialize the SSH2 HMAC factory.
|
protected void |
initializeKeyExchangeFactory(ComponentFactory keyexchange)
Initialize the SSH2 key exchange factory.
|
static void |
initializeProviderForAlgorithm(String jceAlgorithm,
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.
|
static void |
setSecureRandomAlgorithm(String secureRandomAlgorithm)
Set the algorithm used for secure random number generation.
|
getInstance, getPerContextAlgorithmPreferences, init, isEnableNoneCipher, isEnableNoneMac, setEnableNoneCipher, setEnableNoneMac, setInstance, setPerContextAlgorithmPreferences, supportedDigests, supportedHMacsCS, supportedHMacsSC, supportedKeyExchanges, supportedPublicKeys, supportedSsh2CiphersCS, supportedSsh2CiphersSC
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() throws NoSuchAlgorithmException
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) 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) throws SshException
ComponentManager
generateRsaKeyPair
in class ComponentManager
SshException
public SshSecureRandomGenerator getRND() throws SshException
ComponentManager
getRND
in class ComponentManager
SshException
protected void initializeDigestFactory(ComponentFactory digests)
ComponentManager
initializeDigestFactory
in class ComponentManager
protected void initializeHmacFactory(ComponentFactory hmacs)
ComponentManager
initializeHmacFactory
in class ComponentManager
protected void initializeKeyExchangeFactory(ComponentFactory keyexchange)
ComponentManager
initializeKeyExchangeFactory
in class ComponentManager
protected void initializePublicKeyFactory(ComponentFactory publickeys)
ComponentManager
initializePublicKeyFactory
in class ComponentManager
protected void initializeSsh2CipherFactory(ComponentFactory ciphers)
ComponentManager
initializeSsh2CipherFactory
in class ComponentManager
Copyright © 2014. All rights reserved.