Configure the JCE Development Environment

Source: Internet
Author: User

Although jdk1.4 includes the Java security package in the core library, if JCE is not configured, JCE cannot be used for development.

First, go to Sun.Download jce1.2.2(All I see on the Internet is downloading a package, and Sun's default package is useless ),Copy all the jar files in the decompressed lib to your_jdk \ JRE \ Lib \ Ext.(Your_jdk is your JDK installation directory ),Edit your_jdk \ JRE \ Lib \ SECURITY \ Java. Policy File, Add

Grant codebase " File: $ {java. Home}/lib/EXT/sunjce_provider.jar "   {
Permission java. Io. filepermission
" File: $ {java. Home}/lib/EXT/sunjce_provider.jar " , " Read " ;
Permission java. Lang. runtimepermission
" Getprotectiondomain " ;
Permission java. Security. securitypermission
" Putproviderproperty. sunjce " ;
} ;

Grant access permissions to sunjce_provider

The optional provider type is configured in your_jdk \ JRE \ Lib \ SECURITY \ Java. Security. The default configuration is used here. (Here, the provider can also be replaced by the package provided by another vendor. I am not sure how to do it ).
Because I am using JBuilder for development, the link to the relevant database must be added. Therefore, add references to jce1_2_2.jar and sunjce_provider.jar in the properties library settings under the project. After the configuration is complete, you can perform JCE-relatedProgramCompiled.

I used JCE to write a small DES encryption and decryption program. I don't know why, but it runs very slowly. It seems that it takes time to load the provider. Even n doesn't know why Sun uses provider to install components, which is troublesome and unnecessary. I have not completed the configuration in eclipse for half a day, so I am depressed.

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.