Top Description Inners Fields Constructors Methods
org.bouncycastle.jcajce.provider

public final Class BouncyCastleFipsProvider

extends Provider
Class Inheritance
Imports
java.io.IOException, java.lang.reflect.Method, java.security.AccessController, .NoSuchAlgorithmException, .PrivateKey, .PrivilegedAction, .Provider, .PublicKey, .SecureRandom, java.util.ArrayList, .HashMap, .LinkedHashSet, .LinkedList, .List, .Map, .Set, java.util.concurrent.atomic.AtomicBoolean, .AtomicInteger, .AtomicReference, org.bouncycastle.asn1.ASN1ObjectIdentifier, org.bouncycastle.asn1.pkcs.PrivateKeyInfo, org.bouncycastle.asn1.x509.SubjectPublicKeyInfo, org.bouncycastle.crypto.CryptoServicesRegistrar, .EntropySource, .EntropySourceProvider, .SecureRandomProvider, org.bouncycastle.crypto.fips.FipsDRBG, .FipsSecureRandom, .FipsStatus, org.bouncycastle.crypto.util.BasicEntropySourceProvider, org.bouncycastle.util.Arrays, .Pack, .Properties, .Strings

The BC FIPS provider.

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.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
private static class
private static class
private static class
private class
private class

Field Summary

Modifier and TypeField and Description
private final Map<Map<String, String>, Map<String, String>>
private Map<String, EngineCreator>
private static final Map<String, Integer>
private static final Map<String, FipsDRBG.Base>
private BouncyCastleFipsProvider.EntropyDaemon
private volatile SecureRandom
private Thread
private boolean
private static final String
private final Map<ASN1ObjectIdentifier, AsymmetricKeyInfoConverter>
public static final String
private boolean
private FipsDRBG.Base
private int
private final SecureRandomProvider
private int
private int
private Map<String, BouncyCastleFipsProvider.BcService>
private boolean

Constructor Summary

AccessConstructor and Description
public
BouncyCastleFipsProvider()

Base constructor - build a provider with the default configuration.

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.

Method Summary

Modifier and TypeMethod and Description
pack-priv void
addAlgorithmImplementation(String key, String className, Map<String, String> attributes, EngineCreator creator)

pack-priv void
pack-priv void
pack-priv void
pack-priv void
addAlias(String key, String value)

pack-priv void
addAlias(String type, String name, String... aliases)

pack-priv void
pack-priv void
addAttribute(String key, String attributeName, String attributeValue)

pack-priv void
addAttribute(String type, ASN1ObjectIdentifier oid, String attributeName, String attributeValue)

pack-priv void
addAttributes(String key, Map<String, String> attributes)

pack-priv void
pack-priv void
private static boolean
classExists(String className)

public Provider
configure(String
the configuration information for configuring this provider.
configArg
)

Overrides java.security.Provider.configure.

Apply the supplied configuration argument to this Provider instance and return the configured Provider.
private void
doPut(String key, String name)

private String
extractString(char startC, char endC, String command)

private byte[]
private Map<String, String>
getAttributeMap(Map<String, String> attributeMap)

private static SecureRandom
public int

Returns:

the security strength for the default SecureRandom the provider uses.
getDefaultRandomSecurityStrength
()

Return the default random security strength.

public SecureRandom
pack-priv EntropySourceProvider
pack-priv PrivateKey
getPrivateKey(PrivateKeyInfo privateKeyInfo)

pack-priv FipsDRBG.Base
pack-priv int
pack-priv PublicKey
public final synchronized Provider.Service
getService(String
the type of service requested (for example, MessageDigest)
type
,
String
the case-insensitive algorithm name (or alternate alias) of the service requested (for example, SHA-1)
algorithm
)

Overrides java.security.Provider.getService.

Get the service describing this Provider's implementation of the specified type of this algorithm or alias.
public final synchronized Set<Provider.Service>
getServices()

Overrides java.security.Provider.getServices.

Get an unmodifiable Set of all services supported by this Provider.
private boolean
isDisabled(String algName)

private void
Inherited from java.security.Provider:
clearcomputecomputeIfAbsentcomputeIfPresentelementsentrySetforEachgetgetInfogetNamegetOrDefaultgetPropertygetVersiongetVersionStrisConfiguredkeyskeySetloadmergeputputAllputIfAbsentputServiceremoveremoveremoveServicereplacereplacereplaceAlltoStringvalues