?
Install bouncycastle JCE
To install bouncycastle JCE, follow these steps:
1) download provider
As shown above, bouncycastle can be downloaded from www.bouncycastle.org.
Compression.
2) copy the JAR file to the appropriate location
To enable the JCE class to be used by all Java applications, we need to install the JAR file as an extension. The bouncycastle provider does not have a jar file for installation as an extension, but it is easy to build. First, expand the downloaded files to the JDK classes directory, and then run the following command to package these files:
C:/> jar CVF bouncycastle. Jar javax org
In Windows, Java is usually installed in two directories. One directory is used for development, including all JDK tools, and the other is the runtime environment. JDK itself is usually located in a directory such as C:/jdk1.3, while the JDK runtime environment is usually located in a directory such as C:/program files/program oft/jre1.3, they all have Library Extension directories. C:/jdk1.3.1/lib/EXT and C:/program files/javasoft/JRE/1.3/lib/EXT, respectively. The jar files are stored in the corresponding directory.
3) configure the Security Attribute File
The Security Attribute file java. Security is located in another directory parallel to/lib/EXT/lib/security, which defines the currently available encryption providers. See the following statement:
Security. provider.1 = sun. Security. provider. Sun
Security. provider.2 = com. Sun. rsajca. Provider
It indicates that the virtual machine has two encryption providers and their priority and the name used for access. When an encryption algorithm is required, the virtual opportunity will access the providers listed here in turn, find the desired algorithm, and use the first algorithm in the order of priority.
We should insert the following lines in the file to add the new provider:
Security. provider.3 = org. bouncycastle. JCE. provider. bouncycastleprovider
Of course, you can also delete the previous encryption provider configuration so that you cannot use the JDK default encryption provider.
4) Test the installed program
We can write a Test Program (using the JCE package API) to determine whether the installation is successful.
The installation is successful. Let's go to the interesting world of using bouncycastle JCE to implement security functions!