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.
| Modifier and Type | Class and Description |
|---|---|
| private static class |
| Modifier and Type | Field and Description |
|---|---|
| private static final String[] | |
| private static final String[] | |
| private static final String | |
| public static final ProviderConfiguration | |
| private static final String | |
| private static final String[] | |
| private static String | |
| private static final Map | |
| private static final String | |
| private static final String[] | |
| private static final Logger | |
| public static final String | |
| private static final Class | |
| private static final String | |
| private static final String[] | |
| private Map | |
| private static final CryptoServiceProperties[] | |
| private static final String[] | |
| private static final String[] | |
| private static final String |
| Access | Constructor and Description |
|---|---|
| public |
| ASYMMETRIC_CIPHERS | back to summary |
|---|---|
| private static final String[] ASYMMETRIC_CIPHERS | |
| ASYMMETRIC_GENERIC | back to summary |
|---|---|
| private static final String[] ASYMMETRIC_GENERIC | |
| ASYMMETRIC_PACKAGE | back to summary |
|---|---|
| private static final String ASYMMETRIC_PACKAGE | |
| CONFIGURATION | back to summary |
|---|---|
| public static final ProviderConfiguration CONFIGURATION | |
| DIGEST_PACKAGE | back to summary |
|---|---|
| private static final String DIGEST_PACKAGE | |
| DIGESTS | back to summary |
|---|---|
| private static final String[] DIGESTS | |
| info | back to summary |
|---|---|
| private static String info Hides java. | |
| keyInfoConverters | back to summary |
|---|---|
| private static final Map<K, V> keyInfoConverters | |
| KEYSTORE_PACKAGE | back to summary |
|---|---|
| private static final String KEYSTORE_PACKAGE | |
| KEYSTORES | back to summary |
|---|---|
| private static final String[] KEYSTORES | |
| LOG | back to summary |
|---|---|
| private static final Logger LOG | |
| PROVIDER_NAME | back to summary |
|---|---|
| public static final String PROVIDER_NAME | |
| revChkClass | back to summary |
|---|---|
| private static final Class<T> revChkClass | |
| SECURE_RANDOM_PACKAGE | back to summary |
|---|---|
| private static final String SECURE_RANDOM_PACKAGE | |
| SECURE_RANDOMS | back to summary |
|---|---|
| private static final String[] SECURE_RANDOMS | |
| serviceMap | back to summary |
|---|---|
| private Map<String, Provider. | |
| SYMMETRIC_CIPHERS | back to summary |
|---|---|
| private static final CryptoServiceProperties[] SYMMETRIC_CIPHERS | |
| SYMMETRIC_GENERIC | back to summary |
|---|---|
| private static final String[] SYMMETRIC_GENERIC | |
| SYMMETRIC_MACS | back to summary |
|---|---|
| private static final String[] SYMMETRIC_MACS | |
| SYMMETRIC_PACKAGE | back to summary |
|---|---|
| private static final String SYMMETRIC_PACKAGE | |
| BouncyCastleProvider | back to summary |
|---|---|
| public BouncyCastleProvider() Construct a new provider. This should only be required when
using runtime registration of the provider using the
| |
| addAlgorithm | back to summary |
|---|---|
| public void addAlgorithm(String key, String value) Implements org. | |
| addAlgorithm | back to summary |
|---|---|
| public void addAlgorithm(String key, String value, Map<String, String> attributes) Implements org. | |
| addAlgorithm | back to summary |
|---|---|
| public void addAlgorithm(String type, ASN1ObjectIdentifier oid, String className) Implements org. | |
| addAlgorithm | back to summary |
|---|---|
| public void addAlgorithm(String type, ASN1ObjectIdentifier oid, String className, Map<String, String> attributes) Implements org. | |
| addAttributes | back to summary |
|---|---|
| public void addAttributes(String key, Map<String, String> attributeMap) Implements org. | |
| addKeyInfoConverter | back to summary |
|---|---|
| public void addKeyInfoConverter(ASN1ObjectIdentifier oid, AsymmetricKeyInfoConverter keyInfoConverter) Implements org. | |
| getAsymmetricKeyInfoConverter | back to summary |
|---|---|
| private static AsymmetricKeyInfoConverter getAsymmetricKeyInfoConverter(ASN1ObjectIdentifier algorithm) | |
| getKeyInfoConverter | back to summary |
|---|---|
| public AsymmetricKeyInfoConverter getKeyInfoConverter(ASN1ObjectIdentifier oid) Implements org. | |
| getPrivateKey | back to summary |
|---|---|
| public static PrivateKey getPrivateKey(PrivateKeyInfo privateKeyInfo) throws IOException | |
| getPublicKey | back to summary |
|---|---|
| public static PublicKey getPublicKey(SubjectPublicKeyInfo publicKeyInfo) throws IOException | |
| getService | back to summary |
|---|---|
| public final Provider. Overrides java. Doc from java. Get the service describing this Provider's implementation of the
specified type of this algorithm or alias. If no such
implementation exists, this method returns | |
| hasAlgorithm | back to summary |
|---|---|
| public boolean hasAlgorithm(String type, String name) Implements org. | |
| loadAlgorithms | back to summary |
|---|---|
| private void loadAlgorithms(String packageName, String[] names) | |
| loadAlgorithms | back to summary |
|---|---|
| private void loadAlgorithms(String packageName, CryptoServiceProperties[] services) | |
| loadPQCKeys | back to summary |
|---|---|
| private void loadPQCKeys() | |
| loadServiceClass | back to summary |
|---|---|
| private void loadServiceClass(String packageName, String serviceName) | |
| service | back to summary |
|---|---|
| private static CryptoServiceProperties service(String name, int bitsOfSecurity) | |
| setParameter | back to summary |
|---|---|
| public void setParameter(String parameterName, Object parameter) Implements org. | |
| setup | back to summary |
|---|---|
| private void setup() | |
| Modifier and Type | Field and Description |
|---|---|
| private final int | |
| private final String |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public int | |
| public Object | |
| public CryptoServicePurpose | |
| public String |
| bitsOfSecurity | back to summary |
|---|---|
| private final int bitsOfSecurity | |
| name | back to summary |
|---|---|
| private final String name | |
| JcaCryptoService | back to summary |
|---|---|
| pack-priv JcaCryptoService(String name, int bitsOfSecurity) | |
| bitsOfSecurity | back to summary |
|---|---|
| public int bitsOfSecurity() Implements org. | |
| getParams | back to summary |
|---|---|
| public Object getParams() Implements org. | |
| getPurpose | back to summary |
|---|---|
| public CryptoServicePurpose getPurpose() Implements org. | |
| getServiceName | back to summary |
|---|---|
| public String getServiceName() Implements org. | |