DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Please enter at least three characters to search
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Zones

Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

Last call! Secure your stack and shape the future! Help dev teams across the globe navigate their software supply chain security challenges.

Modernize your data layer. Learn how to design cloud-native database architectures to meet the evolving demands of AI and GenAI workloads.

Releasing software shouldn't be stressful or risky. Learn how to leverage progressive delivery techniques to ensure safer deployments.

Avoid machine learning mistakes and boost model performance! Discover key ML patterns, anti-patterns, data strategies, and more.

Related

  • Implementing Cryptography (PGP And JCE) Module With MuleSoft
  • Cryptography Module in Mule 4

Trending

  • Automating Data Pipelines: Generating PySpark and SQL Jobs With LLMs in Cloudera
  • The Role of Functional Programming in Modern Software Development
  • AI-Based Threat Detection in Cloud Security
  • A Guide to Container Runtimes
  1. DZone
  2. Coding
  3. Java
  4. Installing JCE With an Unlimited Strength Jurisdiction Policy

Installing JCE With an Unlimited Strength Jurisdiction Policy

Learn how to quickly and easily install these security files and keep your Java SE-based software safe and secure - as well as how to do it for Mule.

By 
Sanjeet Pandey user avatar
Sanjeet Pandey
·
Oct. 30, 17 · Tutorial
Likes (3)
Comment
Save
Tweet
Share
87.6K Views

Join the DZone community and get the full member experience.

Join For Free

In this article, I'd like to describe how to over come the "org.apache.xml.security.encryption.XMLEncryptionException: Illegal key size or default parameters" or "java.security.InvalidKeyException:illegal Key Size" error message when invoking secured services

These "org.apache.xml.security.encryption.XMLEncryptionException: Illegal key size or default parameters" or "java.security.InvalidKeyException:illegal Key Size" error messages usually occur when we try to invoke web services in a secured manner and your JVM is not provisioned for Java unlimited security jurisdiction.

To provision for the Java unlimited security jurisdiction we have to install Java Cryptography Extension (JCE) unlimited strength jurisdiction policy files.

How to Install JCE:

Windows -

  1. Go to the Oracle Java SE download page.
  2. Scroll down ... Under "Additional Resources" section you will find "Java Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy File."
  3. Download the version that matches your installed JVM for example  UnlimitedJCEPolicyJDK7.zip
  4. Unzip the downloaded zip.
  5. Copy local_policy.jar and US_export_policy.jar to the $JAVA_HOME/jre/lib/security (Note: these jars will be already there so you have to overwrite them).
  6. Then restart your application to get rid of this exception.

Linux/Unix - 

  1. Go to the Oracle Java SE download page.
  2. Scroll down ... Under "Additional Resources" section you will find "Java Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy File."
  3. Download the version that matches your installed JVM, for example,  UnlimitedJCEPolicyJDK7.zip.
  4. Unzip the downloaded zip.
  5. Copy local_policy.jar and US_export_policy.jar to the $JAVA_HOME/jre/lib/security (Note: these jars will be already there so you have to overwrite them).
# cd /usr/lib/jvm/java-1.7.0-oracle-1.7.0.51.x86_64/jre/lib/security
# cp /tmp/UnlimitedJCEPolicyJDK7.zip .
# ls -lhart
drwxrwxr-x.  2 root root 4.0K May 31  2011 UnlimitedJCEPolicy
-rw-r--r--.  1 root root  18K Dec 19  2013 java.security
-rw-r--r--.  1 root root 2.6K Dec 19  2013 java.policy
-rw-r--r--.  1 root root  81K Dec 19  2013 cacerts
-rw-r--r--.  1 root root 2.8K Dec 19  2013 blacklist
lrwxrwxrwx.  1 root root   58 Jul 17 14:15 US_export_policy.jar -> /etc/alternatives/jce_1.7.0_oracle_us_export_policy.x86_64
lrwxrwxrwx.  1 root root   54 Jul 17 14:15 local_policy.jar -> /etc/alternatives/jce_1.7.0_oracle_local_policy.x86_64
drwxr-xr-x. 17 root root 4.0K Nov  5 03:07 ..
-rw-r--r--.  1 root root 7.3K Dec 30 13:27 UnlimitedJCEPolicyJDK7.zip
drwxr-xr-x.  3 root root 4.0K Dec 30 13:28 .
# rm local_policy.jar
# rm US_export_policy.jar
# unzip UnlimitedJCEPolicyJDK7.zip # cp UnlimitedJCEPolicy/US_export_policy.jar . # cp UnlimitedJCEPolicy/local_policy.jar .


In Mule, if you are unable to connect from Mule Management Console to the on-Prem Mule Runtime or API Gateway servers then you have to install the Java Cryptography Extension (JCE) unlimited strength jurisdiction policy files.

Java Cryptography Extension

Opinions expressed by DZone contributors are their own.

Related

  • Implementing Cryptography (PGP And JCE) Module With MuleSoft
  • Cryptography Module in Mule 4

Partner Resources

×

Comments
Oops! Something Went Wrong

The likes didn't load as expected. Please refresh the page and try again.

ABOUT US

  • About DZone
  • Support and feedback
  • Community research
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends:

Likes
There are no likes...yet! 👀
Be the first to like this post!
It looks like you're not logged in.
Sign in to see who liked this post!