Bouncy Castle Cryptography Library 1.77.0

org.bouncycastle.jce.provider
Class BouncyCastleProvider

java.lang.Object
  |
  +--java.util.Dictionary
        |
        +--java.util.Hashtable
              |
              +--java.util.Properties
                    |
                    +--java.security.Provider
                          |
                          +--org.bouncycastle.jce.provider.BouncyCastleProvider
All Implemented Interfaces:
java.lang.Cloneable, ConfigurableProvider, java.util.Map, java.io.Serializable

public final class BouncyCastleProvider
extends java.security.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: 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:
Serialized Form

Inner classes inherited from class java.util.Map
java.util.Map.Entry
 
Field Summary
static ProviderConfiguration CONFIGURATION
           
static java.lang.String PROVIDER_NAME
           
 
Fields 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
BouncyCastleProvider()
          Construct a new provider.
 
Method Summary
 void addAlgorithm(java.lang.String type, ASN1ObjectIdentifier oid, java.lang.String className)
           
 void addAlgorithm(java.lang.String type, ASN1ObjectIdentifier oid, java.lang.String className, java.util.Map attributes)
           
 void addAlgorithm(java.lang.String key, java.lang.String value)
           
 void addAlgorithm(java.lang.String key, java.lang.String value, java.util.Map attributes)
           
 void addAttributes(java.lang.String key, java.util.Map attributeMap)
           
 void addKeyInfoConverter(ASN1ObjectIdentifier oid, AsymmetricKeyInfoConverter keyInfoConverter)
           
 AsymmetricKeyInfoConverter getKeyInfoConverter(ASN1ObjectIdentifier oid)
           
static java.security.PrivateKey getPrivateKey(PrivateKeyInfo privateKeyInfo)
           
static java.security.PublicKey getPublicKey(SubjectPublicKeyInfo publicKeyInfo)
           
 boolean hasAlgorithm(java.lang.String type, java.lang.String name)
           
 void setParameter(java.lang.String parameterName, java.lang.Object parameter)
           
 
Methods inherited from class java.security.Provider
clear, entrySet, getInfo, getName, getVersion, keySet, load, put, putAll, remove, toString, values
 
Methods inherited from class java.util.Properties
getProperty, getProperty, list, list, propertyNames, save, setProperty, store
 
Methods inherited from class java.util.Hashtable
clone, contains, containsKey, containsValue, elements, equals, get, hashCode, isEmpty, keys, rehash, size
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

PROVIDER_NAME

public static final java.lang.String PROVIDER_NAME

CONFIGURATION

public static final ProviderConfiguration CONFIGURATION
Constructor Detail

BouncyCastleProvider

public BouncyCastleProvider()
Construct a new provider. This should only be required when using runtime registration of the provider using the Security.addProvider() mechanism.
Method Detail

setParameter

public void setParameter(java.lang.String parameterName,
                         java.lang.Object parameter)
Specified by:
setParameter in interface ConfigurableProvider

hasAlgorithm

public boolean hasAlgorithm(java.lang.String type,
                            java.lang.String name)
Specified by:
hasAlgorithm in interface ConfigurableProvider

addAlgorithm

public void addAlgorithm(java.lang.String key,
                         java.lang.String value)
Specified by:
addAlgorithm in interface ConfigurableProvider

addAlgorithm

public void addAlgorithm(java.lang.String key,
                         java.lang.String value,
                         java.util.Map attributes)
Specified by:
addAlgorithm in interface ConfigurableProvider

addAlgorithm

public void addAlgorithm(java.lang.String type,
                         ASN1ObjectIdentifier oid,
                         java.lang.String className)
Specified by:
addAlgorithm in interface ConfigurableProvider

addAlgorithm

public void addAlgorithm(java.lang.String type,
                         ASN1ObjectIdentifier oid,
                         java.lang.String className,
                         java.util.Map attributes)
Specified by:
addAlgorithm in interface ConfigurableProvider

addKeyInfoConverter

public void addKeyInfoConverter(ASN1ObjectIdentifier oid,
                                AsymmetricKeyInfoConverter keyInfoConverter)
Specified by:
addKeyInfoConverter in interface ConfigurableProvider

getKeyInfoConverter

public AsymmetricKeyInfoConverter getKeyInfoConverter(ASN1ObjectIdentifier oid)
Specified by:
getKeyInfoConverter in interface ConfigurableProvider

addAttributes

public void addAttributes(java.lang.String key,
                          java.util.Map attributeMap)
Specified by:
addAttributes in interface ConfigurableProvider

getPublicKey

public static java.security.PublicKey getPublicKey(SubjectPublicKeyInfo publicKeyInfo)
                                            throws java.io.IOException

getPrivateKey

public static java.security.PrivateKey getPrivateKey(PrivateKeyInfo privateKeyInfo)
                                              throws java.io.IOException

Bouncy Castle Cryptography Library 1.77.0