public final class BouncyCastleProvider extends Provider implements ConfigurableProvider
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.
Provider.Service| Modifier and Type | Field and Description |
|---|---|
static ProviderConfiguration |
CONFIGURATION |
static String |
PROVIDER_NAME |
defaultsACCEPTABLE_EC_CURVES, ADDITIONAL_EC_PARAMETERS, DH_DEFAULT_PARAMS, EC_IMPLICITLY_CA, THREAD_LOCAL_DH_DEFAULT_PARAMS, THREAD_LOCAL_EC_IMPLICITLY_CA| Constructor and Description |
|---|
BouncyCastleProvider()
Construct a new provider.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addAlgorithm(String type,
ASN1ObjectIdentifier oid,
String className) |
void |
addAlgorithm(String key,
String value) |
void |
addAttributes(String key,
Map<String,String> attributeMap) |
void |
addKeyInfoConverter(ASN1ObjectIdentifier oid,
AsymmetricKeyInfoConverter keyInfoConverter) |
static PrivateKey |
getPrivateKey(PrivateKeyInfo privateKeyInfo) |
static PublicKey |
getPublicKey(SubjectPublicKeyInfo publicKeyInfo) |
boolean |
hasAlgorithm(String type,
String name) |
void |
setParameter(String parameterName,
Object parameter) |
clear, compute, computeIfAbsent, computeIfPresent, elements, entrySet, forEach, get, getInfo, getName, getOrDefault, getProperty, getService, getServices, getVersion, keys, keySet, load, merge, put, putAll, putIfAbsent, putService, remove, remove, removeService, replace, replace, replaceAll, toString, valuesgetProperty, list, list, load, loadFromXML, propertyNames, save, setProperty, store, store, storeToXML, storeToXML, stringPropertyNamesclone, contains, containsKey, containsValue, equals, hashCode, isEmpty, rehash, sizepublic static final String PROVIDER_NAME
public static final ProviderConfiguration CONFIGURATION
public BouncyCastleProvider()
Security.addProvider() mechanism.public void setParameter(String parameterName, Object parameter)
setParameter in interface ConfigurableProviderpublic boolean hasAlgorithm(String type, String name)
hasAlgorithm in interface ConfigurableProviderpublic void addAlgorithm(String key, String value)
addAlgorithm in interface ConfigurableProviderpublic void addAlgorithm(String type, ASN1ObjectIdentifier oid, String className)
addAlgorithm in interface ConfigurableProviderpublic void addKeyInfoConverter(ASN1ObjectIdentifier oid, AsymmetricKeyInfoConverter keyInfoConverter)
addKeyInfoConverter in interface ConfigurableProviderpublic void addAttributes(String key, Map<String,String> attributeMap)
addAttributes in interface ConfigurableProviderpublic static PublicKey getPublicKey(SubjectPublicKeyInfo publicKeyInfo) throws IOException
IOExceptionpublic static PrivateKey getPrivateKey(PrivateKeyInfo privateKeyInfo) throws IOException
IOExceptionCopyright © 2015–2019 The veraPDF Consortium. All rights reserved.