If no SecureRandom has been specified using CryptoServicesRegistrar.setSecureRandom() the provider class will generate a FIPS compliant DRBG based on SHA-512. It is also possible to configure the DRBG by passing a string as a constructor argument to the provider via code, or the java.security configuration file.
At the moment the configuration string is limited to setting the DRBG.The configuration string must always start with "C:" and finish with "ENABLE{ALL};". The command for setting the actual DRBG type is DEFRND so a configuration string requesting the use of a SHA1 DRBG would look like:
C:DEFRND[SHA1];ENABLE{ALL};
Possible values for the DRBG type are "SHA1", "SHA224", "SHA256", "SHA384", "SHA512", "SHA512(224)", "SHA512(256)",
"HMACrovRandSHA1", "HMACSHA224", "HMACSHA256", "HMACSHA384", "HMACSHA512", "HMACSHA512(224)", "HMACSHA512(256)", "CTRAES128",
"CTRAES192", CTRAES256", and "CTRDESEDE".
The default DRBG is configured to be prediction resistant. In situations where the amount of entropy is constrained the default DRBG can be configured to use an entropy pool based on a SHA-512 SP 800-90A DRBG. To configure this use:
C:HYBRID;ENABLE{ALL};
or include the string "HYBRID;" in the previous command string setting the DRBG. After initial seeding the entropy pool will
start a reseeding thread which it will begin polling once 20 samples have been taken since the last seeding and will do a reseed
as soon as new entropy bytes are returned.
Note
if the provider is created by an "approved mode" thread, only FIPS approved algorithms will be available from it.
| Modifier and Type | Class and Description |
|---|---|
| private static class | |
| private static class | |
| private static class | |
| private static class | |
| private class | |
| private class |
| Modifier and Type | Field and Description |
|---|---|
| private final Map | |
| private Map | |
| private static final Map | |
| private static final Map | |
| private BouncyCastleFipsProvider. | |
| private volatile SecureRandom | |
| private Thread | |
| private boolean | |
| private static final String | |
| private final Map | |
| public static final String | |
| private boolean | |
| private FipsDRBG. | |
| private int | |
| private final SecureRandomProvider | |
| private int | |
| private int | |
| private Map | |
| private boolean |
| Access | Constructor and Description |
|---|---|
| public | |
| public | BouncyCastleFipsProvider(String
the config string. config)Constructor accepting a configuration string. |
| public | BouncyCastleFipsProvider(String
the config string. config, SecureRandom a SecureRandom which can act as an entropy source. entropySource)Constructor accepting a config string and a user defined source of entropy to be used for the providers locally configured DRBG. |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv void | addAlgorithmImplementation(String key, String className, Map<String, String> attributes, EngineCreator creator)
|
| pack-priv void | |
| pack-priv void | addAlgorithmImplementation(String type, ASN1ObjectIdentifier oid, String className, EngineCreator creator)
|
| pack-priv void | addAlgorithmImplementation(String type, ASN1ObjectIdentifier oid, String className, Map<String, String> attributes, EngineCreator creator)
|
| pack-priv void | |
| pack-priv void | |
| pack-priv void | |
| pack-priv void | |
| pack-priv void | |
| pack-priv void | |
| pack-priv void | |
| pack-priv void | |
| private static boolean | |
| public Provider | configure(String
the configuration information for configuring this
provider. configArg)Overrides java. Provider
instance and return the configured Provider.
|
| private void | |
| private String | |
| private byte[] | |
| private Map | |
| private static SecureRandom | |
| public int | Returns: the security strength for the default SecureRandom the provider uses.Return the default random security strength. |
| public SecureRandom | |
| pack-priv EntropySourceProvider | |
| pack-priv PrivateKey | |
| pack-priv FipsDRBG. | |
| pack-priv int | |
| pack-priv PublicKey | |
| public final synchronized Provider. | getService(String
the type of type, String service requested
(for example, MessageDigest)the case-insensitive algorithm name (or alternate
alias) of the service requested (for example, algorithm)SHA-1)Overrides java. |
| public final synchronized Set | getServices()
Overrides java. Provider.
|
| private boolean | |
| private void |