Package org.bouncycastle.jce.provider
Class BouncyCastleProvider
java.lang.Object
java.util.Dictionary<Object,Object>
java.util.Hashtable<Object,Object>
java.util.Properties
java.security.Provider
org.bouncycastle.jce.provider.BouncyCastleProvider
- All Implemented Interfaces:
Serializable
,Cloneable
,Map<Object,
,Object> ConfigurableProvider
To add the provider at runtime use:
import java.security.Security; import org.bouncycastle.jce.provider.BouncyCastleProvider; Security.addProvider(new BouncyCastleProvider());The provider can also be configured as part of your environment via static registration by adding an entry to the java.security properties file (found in $JAVA_HOME/jre/lib/security/java.security, where $JAVA_HOME is the location of your JDK/JRE distribution). You'll find detailed instructions in the file but basically it comes down to adding a line:
security.provider.<n>=org.bouncycastle.jce.provider.BouncyCastleProvider
Where <n> is the preference you want the provider at (1 being the
most preferred).
Note: JCE algorithm names should be upper-case only so the case insensitive test for getInstance works.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.security.Provider
Provider.Service
-
Field Summary
FieldsFields inherited from class java.util.Properties
defaults
Fields inherited from interface org.bouncycastle.jcajce.provider.config.ConfigurableProvider
ACCEPTABLE_EC_CURVES, ADDITIONAL_EC_PARAMETERS, DH_DEFAULT_PARAMS, EC_IMPLICITLY_CA, THREAD_LOCAL_DH_DEFAULT_PARAMS, THREAD_LOCAL_EC_IMPLICITLY_CA
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addAlgorithm
(String key, String value) void
void
addAlgorithm
(String type, ASN1ObjectIdentifier oid, String className) void
addAlgorithm
(String type, ASN1ObjectIdentifier oid, String className, Map<String, String> attributes) void
addAttributes
(String key, Map<String, String> attributeMap) void
addKeyInfoConverter
(ASN1ObjectIdentifier oid, AsymmetricKeyInfoConverter keyInfoConverter) static PrivateKey
getPrivateKey
(PrivateKeyInfo privateKeyInfo) static PublicKey
getPublicKey
(SubjectPublicKeyInfo publicKeyInfo) final Provider.Service
getService
(String type, String algorithm) boolean
hasAlgorithm
(String type, String name) void
setParameter
(String parameterName, Object parameter) Methods inherited from class java.security.Provider
clear, compute, computeIfAbsent, computeIfPresent, configure, elements, entrySet, forEach, get, getInfo, getName, getOrDefault, getProperty, getServices, getVersion, getVersionStr, isConfigured, keys, keySet, load, merge, put, putAll, putIfAbsent, putService, remove, remove, removeService, replace, replace, replaceAll, toString, values
Methods inherited from class java.util.Properties
clone, contains, containsKey, containsValue, equals, getProperty, hashCode, isEmpty, list, list, load, loadFromXML, propertyNames, rehash, save, setProperty, size, store, store, storeToXML, storeToXML, storeToXML, stringPropertyNames
-
Field Details
-
PROVIDER_NAME
- See Also:
-
CONFIGURATION
-
-
Constructor Details
-
BouncyCastleProvider
public BouncyCastleProvider()Construct a new provider. This should only be required when using runtime registration of the provider using theSecurity.addProvider()
mechanism.
-
-
Method Details
-
getService
- Overrides:
getService
in classProvider
-
setParameter
- Specified by:
setParameter
in interfaceConfigurableProvider
-
hasAlgorithm
- Specified by:
hasAlgorithm
in interfaceConfigurableProvider
-
addAlgorithm
- Specified by:
addAlgorithm
in interfaceConfigurableProvider
-
addAlgorithm
- Specified by:
addAlgorithm
in interfaceConfigurableProvider
-
addAlgorithm
- Specified by:
addAlgorithm
in interfaceConfigurableProvider
-
addAlgorithm
public void addAlgorithm(String type, ASN1ObjectIdentifier oid, String className, Map<String, String> attributes) - Specified by:
addAlgorithm
in interfaceConfigurableProvider
-
addKeyInfoConverter
public void addKeyInfoConverter(ASN1ObjectIdentifier oid, AsymmetricKeyInfoConverter keyInfoConverter) - Specified by:
addKeyInfoConverter
in interfaceConfigurableProvider
-
getKeyInfoConverter
- Specified by:
getKeyInfoConverter
in interfaceConfigurableProvider
-
addAttributes
- Specified by:
addAttributes
in interfaceConfigurableProvider
-
getPublicKey
- Throws:
IOException
-
getPrivateKey
- Throws:
IOException
-