Bouncycastle JCE Practice (II.)

Source: Internet
Author: User
-->
-->

Install bouncycastle JCE

Install bouncycastle JCE should follow the steps below :

1) download provider

As above,bouncycastle can download from the www.bouncycastle.org, download it after the solution

Compression.

2 Copy the JAR file to the appropriate location

If you want class can be all java application use, we need to put jar file installed as an extension. bouncycastle provider is not used to install as an extended jar file, but it's easy to build. First, the downloaded file is expanded to jdkclasses " " /span>

C:> jar CVF Bouncycastle.jar javax org

In Windows ,Java is typically installed in two directories. One directory for development, including all JDK tools, and the other is just a running environment. The JDK itself is typically located in c:jdk1.3 such as the jdk, which is typically located in a directory such as C:Program filesJavaSoftJRE1.3, which has an extended directory of libraries. respectively: C:jdk1.3.1libext and C:Program Filesjavasoftjre1.3libext, put the desired jar file in the corresponding directory.

3) Configure the Security properties file

The security properties file Java.security is located under another directory libsecurity that is parallel to Libext, which defines the cryptographic providers that are currently available. If you see the following statement:

Security.provider.1=sun.security.provider.sun

Security.provider.2=com.sun.rsajca.provider

It shows that this virtual machine has two cryptographic providers and their priorities and the names that are used when they are accessed. When a cryptographic algorithm is needed, the virtual opportunity accesses the providers listed here, searching for the desired algorithm, and using the first found algorithm in order of precedence here.

We should insert the following line in the file to add the new provider:

Security.provider.3=org.bouncycastle.jce.provider.bouncycastleprovider

Of course , you can also remove the previous cryptographic provider configuration so that you cannot use the JDK default cryptographic provider.

4 test the installation of a good program

We can write a test program (using the API of the JCE package) to determine whether our installation was successful or not.

The installation is successful , let us enter the fun world with Bouncycastle JCE to realize the security function !

-->
-->

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.