Package org.bouncycastle.jce.provider
Class BouncyCastleProvider
- java.lang.Object
-
- java.util.Dictionary<K,V>
-
- 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
public final class BouncyCastleProvider extends Provider implements 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:
Where <n> is the preference you want the provider at (1 being the most preferred).security.provider.<n>=org.bouncycastle.jce.provider.BouncyCastleProviderNote: JCE algorithm names should be upper-case only so the case insensitive test for getInstance works.
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static ProviderConfigurationCONFIGURATIONstatic StringPROVIDER_NAME-
Fields inherited from class java.util.Properties
defaults
-
Fields inherited from interface org.bouncycastle.jcajce.provider.config.ConfigurableProvider
DH_DEFAULT_PARAMS, EC_IMPLICITLY_CA, THREAD_LOCAL_DH_DEFAULT_PARAMS, THREAD_LOCAL_EC_IMPLICITLY_CA
-
-
Constructor Summary
Constructors Constructor Description BouncyCastleProvider()Construct a new provider.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddAlgorithm(String key, String value)voidaddKeyInfoConverter(ASN1ObjectIdentifier oid, AsymmetricKeyInfoConverter keyInfoConverter)static PrivateKeygetPrivateKey(PrivateKeyInfo privateKeyInfo)static PublicKeygetPublicKey(SubjectPublicKeyInfo publicKeyInfo)booleanhasAlgorithm(String type, String name)voidsetParameter(String parameterName, Object parameter)-
Methods inherited from class java.security.Provider
clear, entrySet, getInfo, getName, getService, getServices, getVersion, keySet, load, put, putAll, putService, remove, removeService, toString, values
-
Methods inherited from class java.util.Properties
getProperty, getProperty, list, list, load, loadFromXML, propertyNames, save, setProperty, store, store, storeToXML, storeToXML, stringPropertyNames
-
-
-
-
Field Detail
-
PROVIDER_NAME
public static final String PROVIDER_NAME
- See Also:
- Constant Field Values
-
CONFIGURATION
public static final ProviderConfiguration CONFIGURATION
-
-
Method Detail
-
setParameter
public void setParameter(String parameterName, Object parameter)
- Specified by:
setParameterin interfaceConfigurableProvider
-
hasAlgorithm
public boolean hasAlgorithm(String type, String name)
- Specified by:
hasAlgorithmin interfaceConfigurableProvider
-
addAlgorithm
public void addAlgorithm(String key, String value)
- Specified by:
addAlgorithmin interfaceConfigurableProvider
-
addKeyInfoConverter
public void addKeyInfoConverter(ASN1ObjectIdentifier oid, AsymmetricKeyInfoConverter keyInfoConverter)
- Specified by:
addKeyInfoConverterin interfaceConfigurableProvider
-
getPublicKey
public static PublicKey getPublicKey(SubjectPublicKeyInfo publicKeyInfo) throws IOException
- Throws:
IOException
-
getPrivateKey
public static PrivateKey getPrivateKey(PrivateKeyInfo privateKeyInfo) throws IOException
- Throws:
IOException
-
-