|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sshtools.jce.JCEProviderMapping
This class provides the ability to configure the Maverick API to use
a JCE rather than the internal Maverick Crypto API. To enable JCE usage
simply call the following method:
// To enable JCE with default provider JCEProviderMapping.enableJCEProvider(true); // To enable JCE with specific provider JCEProviderMapping.enableJCEProvider("Bouncycastle"); // To disable JCE JCEProviderMapping.enableJCEProvider(false);
When a JCE is in use the default behaviour is to request all algorithm
implementations without specifying a provider; this enables JCE to work with
the Sun reference and SunJCE providers that are installed by default. You
can configure a provider either for all or for an individual algorithm. The algorithms
required for a default installation are:
DESede/CBC/NoPadding (Cipher) Blowfish/CBC/NoPadding (Cipher) MD5 (Digest) SHA-1 (Digest) HmacSha1 (HMAC) HmacMD5 (HMAC) RSA (Public key) DSA (Public key) SHA1withRSA (Signature) SHA1withDSA (Signature)
If you add any further algorithm implementations or you want to change
from the default provider you will need to specify the provider using:
// To configure an provider for an individual algorithm JCEProviderMapping.setProviderForAlgorithm("AES/CBC/NoPadding", "Bouncycastle"); // To configure a provider for all algorithms JCEProviderMapping.setProvider("Bouncycastle");
Field Summary | |
static java.lang.String |
DEFAULT_PROVIDER
Identifies the default provider |
Constructor Summary | |
JCEProviderMapping()
|
Method Summary | |
static boolean |
containsProvider(java.lang.String algorithm)
|
static void |
enableJCEProvider(boolean enabled)
Enable JCE mode and configure all algorithms to use the default provider. |
static void |
enableJCEProvider(java.lang.String provider)
Enable JCE mode and configure all algorithms to use the specified provider. |
static java.lang.String |
getProvider(java.lang.String algorithm)
|
static java.lang.String[] |
getRequiredAlgorithms()
Returns an array of all the algorithms currently required by the Maverick API. |
static boolean |
isJCEEnabled()
Determine if JCE mode is enabled |
static void |
setProvider(java.lang.String provider)
Sets the provider for all currently configured algorithms. |
static void |
setProviderForAlgorithm(java.lang.String algorithm,
java.lang.String provider)
Set the provider for an individual algorithm. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static java.lang.String DEFAULT_PROVIDER
Constructor Detail |
public JCEProviderMapping()
Method Detail |
public static boolean containsProvider(java.lang.String algorithm)
public static java.lang.String getProvider(java.lang.String algorithm)
public static void setProvider(java.lang.String provider)
provider
- Stringpublic static boolean isJCEEnabled()
public static java.lang.String[] getRequiredAlgorithms()
public static void enableJCEProvider(java.lang.String provider)
provider
- Stringpublic static void enableJCEProvider(boolean enabled)
enabled
- booleanpublic static void setProviderForAlgorithm(java.lang.String algorithm, java.lang.String provider)
algorithm
- Stringprovider
- String
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |