Tuesday, May 8, 2012

How to install Java Cryptography Extension (JCE) unlimited strength jurisdiction policy files


How to over come "org.apache.xml.security.encryption.XMLEncryptionException: Illegal key size or default parameters" or "java.security.InvalidKeyException:illegal Key Size" error 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 usually occurs when we try to invoke a 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

  1. Go to the Oracle Java SE download page http://www.oracle.com/technetwork/java/javase/downloads/index.html
  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 E.g. 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.

257 comments:

  1. Another solution ist to execute this:

    try {
    Field field = Class.forName("javax.crypto.JceSecurity").
    getDeclaredField("isRestricted");
    field.setAccessible(true);
    field.set(null, java.lang.Boolean.FALSE);
    } catch (Exception ex) {
    ex.printStackTrace();
    }

    ReplyDelete
    Replies
    1. This is just Great! I was so tired to change them at every java update!

      Delete
    2. I am using java version 1.6.0_35, which doesn't have class javax.crypto.JceSecurity. Any equivalent class in 1.6.0_35 jce.jar?

      Many thanks!

      Delete
    3. Many thanks!! It saves me a tremendous time and releases my stress from completing my task on time!

      Thanks Suho fro creating this blob too!!

      Delete
    4. Where do I paste that code?

      Delete
    5. Careful with this Reflection. USA doesn't like exporting high-grade encryption to some countries. Oracle's JCE might have export restrictions. If your code circumvents this in production-code you could cause trouble for yourself

      Delete
  2. Hi Suho..

    Thanks you very much.. It helped me :)

    -Sam

    ReplyDelete
  3. Helped! Much thanks.

    ReplyDelete
  4. So the script works and is running, now what?

    ReplyDelete
  5. Hi, I just wanted to check if java 1.7.x supports JCE ? I am trying to install java with jce. Then after installing jdk should I follow the steps you gave me to finish this task ?

    ReplyDelete
  6. Hi. Thank you very much. It worked!

    ReplyDelete
  7. Hi, thanks for the help but I have another question how do I undo or reverse to the previous version of this thing :P

    ReplyDelete
  8. Download from this link

    http://www.oracle.com/technetwork/java/javase/downloads/jce-7-download-432124.html

    ReplyDelete
  9. Hello! This solution is Excellent!! Thank YOU Suhorish!

    ReplyDelete
  10. Excellent Solution!!!
    Thank You Suhorish!

    ReplyDelete
  11. I download JCE file but one thing I could not figure out how to put local_policy.jar and US_export_policy.jar to the $JAVA_HOME/jre/lib/security. Foremost problem is how to find $JAVA_HOME/jre/lib/security. Please help urgent.

    ReplyDelete
  12. Hi Manoj KC. $JAVA_HOME is nothing but the home directory of your jdk.It is the folder where you installed the jdk.most probably it in in C://Program Files/Java folder.

    ReplyDelete
  13. Thanks a lot, It saved me a lot!!!

    ReplyDelete
  14. Do I put this at the beginning of my encryption code?

    ReplyDelete
  15. Hi Suho, I really need your help. Do I need to restart my machine after adding the new JCE Provider for it to take effect?

    ReplyDelete
  16. Thanks, it's helpful.

    ReplyDelete
  17. Awesome.. I have been trying this for 2-3 days. At last, I could run my program.
    Thanks to you!

    ReplyDelete
  18. I am working in a Digital Signing Server Service. I am looking for the Java code for SHA 512 or RSA, an a DB for public key. Is there that code in the Internet????

    See my Blog blog del Ing. Ernesto Ibáñez

    ReplyDelete
  19. Thank you for sharing such a nice and interesting blog with us. i have seen that all will say the same thing repeatedly. But in your blog, I had a chance to get some useful and unique information. I would like to suggest your blog in my dude circle.
    Java Training in Chennai

    ReplyDelete
  20. It is a great article. You will surely like this also because it is a great stufff


    Facebook Lite

    ReplyDelete
  21. How to ensure that the Java Cryptography Extension has been installed?

    ReplyDelete
  22. Your post is interesting. Hope you have more useful posts like this

    Android Training Institute in Chennai

    ReplyDelete
  23. • Nice and good article. It is very useful for me to learn and understand easily. Thanks for sharing your valuable information and time. Please keep updating mulesoft Online Training Hyderabad

    ReplyDelete
  24. Thank you so much. This article helped me a lot in my work.
    Keep posting such informative articles.

    ReplyDelete
  25. terimakasih infonya, silahkan cek website Nonton Movie Online & Nonton Bioskop Online kami.terima kasih

    ReplyDelete
  26. hi here you can play free games

    ReplyDelete
  27. here you can play action games

    ReplyDelete
  28. here you can play free action games

    ReplyDelete
  29. play more free action games here

    ReplyDelete
  30. Permainan seru ini dapat dimainkan di dalam Hp Android anda dan permainan ini juga sangat cocok menemani luang waktu anda untuk kamu yang baru ingin bergabung dan hanya deposit 20.000ribu saja.
    untuk info lebih lanjut silakan hubungi
    -LIVE CHAT : www,mgmdomino,net
    -BBM D88FDB2E
    -WHATSAPP +85577597038
    KEPUASAN ANDA ADALAH KEBANGGAAN KAMI..!!!
    MGMPOPKER88

    ReplyDelete
  31. lordz io hey if you want to play more action games so click here and get what you want

    ReplyDelete
  32. Wow it is really wonderful and awesome thus it is very much useful for me to understand many concepts and helped me a lot. it is really explainable very well and i got more information from your blog.
    python training in chennai | python course institute in chennai

    ReplyDelete
  33. This comment has been removed by the author.

    ReplyDelete
  34. I was recommended this web site by means of my cousin. I am now not certain whether this post is written through him as nobody else recognise such precise about my difficulty. You're amazing! Thank you!
    angularjs Training in marathahalli

    angularjs interview questions and answers

    angularjs Training in bangalore

    angularjs Training in bangalore

    angularjs Training in chennai

    automation anywhere online Training

    ReplyDelete
  35. I am so proud of you and your efforts and work make me realize that anything can be done with patience and sincerity. Well I am here to say that your work has inspired me without a doubt.
    online Python training
    python training in chennai

    ReplyDelete
  36. The site was so nice, I found out about a lot of great things. I like the way you make your blog posts. Keep up the good work and may you gain success in the long run.
    Python training in bangalore
    Python course in pune
    Python training in bangalore
    python training in chennai
    python course institute in chennai

    ReplyDelete

  37. Greetings. I know this is somewhat off-topic, but I was wondering if you knew where I could get a captcha plugin for my comment form? I’m using the same blog platform like yours, and I’m having difficulty finding one? Thanks a lot.

    AWS Interview Questions And Answers

    AWS Tutorial |Learn Amazon Web Services Tutorials |AWS Tutorial For Beginners


    AWS Online Training | Online AWS Certification Course - Gangboard

    AWS Training in Toronto| Amazon Web Services Training in Toronto, Canada

    ReplyDelete
  38. Inspiring writings and I greatly admired what you have to say , I hope you continue to provide new ideas for us all and greetings success always for you..Keep update more information.

    rpa training in chennai
    rpa training in bangalore
    rpa course in bangalore
    best rpa training in bangalore
    rpa online training

    ReplyDelete
  39. Inspiring writings and I greatly admired what you have to say , I hope you continue to provide new ideas for us all and greetings success always for you..Keep update more information.

    rpa training in chennai
    rpa training in bangalore
    rpa course in bangalore
    best rpa training in bangalore
    rpa online training

    ReplyDelete
  40. Hey, wow all the posts are very informative for the people who visit this site. Good work! We also have a Website. Please feel free to visit our site. Thank you for sharing.
    Well written article.Thank You Sharing with Us android code best practices | android development for beginners | future of android development 2018 | android device manager location history

    ReplyDelete
  41. Nice blog..! I really loved reading through this article. Thanks for sharing such an amazing post with us and keep blogging... Well written article.Thank You for Sharing with Us Please keep Sharing angular 7 training in chennai | angular 7 training in velachery | Best angular training institute in chennai

    ReplyDelete
  42. Thanks for the informative article. This is one of the best resources I have found in quite some time. Nicely written and great info. I really cannot thank you enough for sharing.

    Java training in Chennai | Java training in Tambaram

    Java training in Chennai | Java training in Velachery

    Java training in Chennai | Java training in Omr

    Oracle training in Chennai

    ReplyDelete
  43. This is a good post. This post give truly quality information. I’m definitely going to look into it. Really very useful tips are provided here. thank you so much. Keep up the good works.
    angularjs-Training in tambaram

    angularjs-Training in sholinganallur

    angularjs-Training in velachery

    angularjs Training in bangalore

    angularjs Training in bangalore

    ReplyDelete
  44. Very useful post. The information stated in the article is very practical. The writing style is also easily understandable. Thankyou for sharing..

    big data hadoop online training
    business analytics training online

    ReplyDelete
  45. I am so proud of you and your efforts and work make me realize that anything can be done with patience and sincerity. Well I am here to say that your work has inspired me without a doubt.
    angularjs Training in chennai

    angularjs Training in chennai

    angularjs-Training in tambaram

    angularjs-Training in sholinganallur

    angularjs-Training in velachery

    angularjs-Training in pune

    ReplyDelete
  46. Many thanks!! It saves me a tremendous time and releases my stress from completing my task on time!

    Thanks Suho fro creating this blob too!!

    ReplyDelete
  47. Thank you so much for this pattern. I found you through ravelry. I am about 1/3 the way through making this. I started right after I started reading your pattern. Thanks again!

    ReplyDelete
  48. Nice blog..! I really loved reading through this article

    ReplyDelete
  49. menangqq is the best platform for gambling!!

    ReplyDelete
  50. join and enjoy our domino game here!!

    ReplyDelete
  51. Very nice post here thanks for it .I always like and such a super contents of these post.Excellent and very cool idea and great content of different kinds of the valuable information's.

    machine learning training in chennai
    machine learning training in omr
    top institutes for machine learning in chennai
    Android training in chennai
    PMP training in chennai

    ReplyDelete
  52. This comment has been removed by the author.

    ReplyDelete
  53. Thanks for sharing this information... Conatct Veelead for SharePoint Migration Services

    ReplyDelete
  54. Very Nice Article keep it up...! Thanks for sharing this amazing information with us...! keep sharing

    ReplyDelete
  55. its a good post and keep posting good article.its very interesting to read.
    Regards,
    Devops Training Institute in Chennai

    ReplyDelete
  56. I would like to appreciate for doing this works. Thankyou to Share this.
    Regards,
    Best Devops Training in Chennai | Best Devops Training Institute in Chennai

    ReplyDelete
  57. After reading this web site I am very satisfied simply because this site is providing comprehensive knowledge for you to audience.
    Thank you to the perform as well as discuss anything incredibly important in my opinion. We loose time waiting for your next article writing in addition to I beg one to get back to pay a visit to our website in



    selenium training in Bangalore
    selenium training in Marathahalli
    selenium training in Btm layout
    selenium training in Jaya nagar
    selenium training in Electronic city
    selenium training in Kalyan nagar



    ReplyDelete
  58. It is amazing and wonderful to visit your site.Thanks for sharing this information,this is useful to me...









    ReplyDelete
  59. This post is much helpful for us. This is really very massive value to all the readers and it will be the only reason for the post to get popular with great authority
    mi service center in chennai
    redmi service center in chennai
    xiaomi service centre chennai
    redmi service center
    mi service center
    redmi service center near me
    redmi mobile service centre in chennai

    ReplyDelete
  60. Thanks for posting useful information.You have provided an nice article, Thank you very much for this one. And i hope this will be useful for many people.. and i am waiting for your next post keep on updating these kinds of knowledgeable things...Really it was an awesome article...very interesting to read..please sharing like this information......
    lenovo mobile service center near me
    lenovo mobile service centre in chennai
    lenovo service center in velachery
    lenovo service center in porur
    lenovo service center in vadapalani

    ReplyDelete
  61. Nonton Film dan Download Film Indonesia Subtitle Indonesia http://hokixxi.com/

    Nonton Film Online
    Nonton Film Indonesia
    Nonton Bioskop Online

    ReplyDelete
  62. It's Very informative blog and useful article thank you for sharing with us , keep posting learn more about BI Tools Thanks for sharing valuable information. Your blogs were helpful to tableau learners. I request to update the blog through step-by-step. Also, find Technology news at
    Tableau Training

    Android Online Training

    Data Science Certification

    Dot net Training in bangalore
    href="https://onlineitguru.com/ios-online-training-placement.html
    "title="iOS development course | learn swift | OnlineITGuru
    ">iOS Developement Course

    Blog.

    ReplyDelete
  63. Halo! Solusi ini Luar Biasa !! Terima kasih, Suhorish!

    Please Follow and Visit my blog

    Live Togel Singapore

    thanks to you admin

    ReplyDelete
  64. Nice post. I learned some new information. Thanks for sharing.

    Article submission sites
    Technology

    ReplyDelete
  65. Nonton Film dan Download Film Indonesia Subtitle Indonesia http://gudangxxi.com/

    Nonton Film Online
    Nonton Movie Online
    Nonton Bioskop Online

    ReplyDelete
  66. Halo Sayang mau cari Agen Main poker online ? tapi yang aman dan terpercaya ?
    Menang 10 juta ? 20 juta ? 50 juta ? bahkan 100 juta ? Pasti Kami bayar sayang ku

    Gak percaya ? pasti dong lagian belum daftar dan main di sini

    Ayo daftar SEKARANG http://KASTILPOKER.COM Agent Poker Online Terpercaya

    Enaknya main di KASTILPOKER.COM cuma Rp 10 ribu doang sudah bisa bermain di KASTILPOKER dan dapat bermain banyak game seperti CEME, POKER, CAPSA, DOMINO dan yang lain nya
    # Ada Super Bonus Vaganza Total Hadiah Hingga Ratusan Juta Dengan hadiah Utama 1 Unit Motor KAWASAKI NINJA 250 SL
    # Jackpot Selalu ada Setiap Harinya
    # Proses Deposit dan Withdraw Sangat Cepat
    # Bonus refferal dari 15%- 100% seumur hidup ( harus daftar melalui link referal bos baru bisa dapet referal ya )
    Server Tercepat IDNPLAY tanpa bot Player vs Player

    Chat Langsung Dengan Kami
    WA : +855884290569
    BBM : kastilpoker
    LINE : kastilpoke

    ReplyDelete
  67. Great efforts put it to find the list of articles which is very useful to know, Definitely will share the
    same to other forums.
    big data training in chennai | best hadoop training in chennai | big data course in chennai | big data hadoop interview quesions and answers pdf|

    ReplyDelete
  68. I like viewing web sites which comprehend the price of delivering the excellent useful resource free of charge. I truly adored reading your posting. Thank you!data science course in dubai

    ReplyDelete
  69. Easily, the article is actually the best about Extension installation issue. thanks for sharing

    ExcelR Data Science Course in Bangalore

    ReplyDelete
  70. Attend The Python Training in Hyderabad From ExcelR. Practical Python Training Sessions With Assured Placement Support From Experienced Faculty. ExcelR Offers The Python Training in Hyderabad.
    python training in bangalore

    ReplyDelete
  71. I have to search sites with relevant information on given topic and provide them to teacher our opinion and the article.
    date analytics certification training courses
    data science courses training
    data analytics certification courses in Bangalore

    ReplyDelete
  72. Outstanding blog thanks for sharing such wonderful blog with us ,after long time came across such knowlegeble blog. keep sharing such informative blog with us.

    big data training in chennai chennai tamilnadu | big data hadoop training in velachery | big data training in velachery | big data hadoop interview quesions and answers pdf| mapreduce interview questions

    ReplyDelete

  73. Personally I think overjoyed I discovered the blogs.

    BIG DATA COURSE MALAYSIA

    ReplyDelete
  74. The best use of cryptography is to encrypt communications between one and another system. this is mainly used for communication. learn more in blockchain online course

    ReplyDelete
  75. Website Planning Best institute for digital marketing course in delhi. Initialisation of Digital Marketing.. Website Creation. Content Writing. Search Engine Optimization. Local Seo. Google Webmaster. Bing Webmaster. Digital Marketing course in Laxmi Nagar

    ReplyDelete
  76. Nonton Film dan Download Film Indonesia Subtitle Indonesia http://gudangxxi.com/

    Nonton Film Terbaru
    Nonton Movie Online
    Nonton Bioskop Online

    ReplyDelete
  77. In encryption algorithm namely symmetric and symmetric cryptography are required. one can requires the sender and receiver can share a keyl learn more in blockchain online course

    ReplyDelete
  78. Great post i must say and thanks for the information. Education is definitely a sticky subject. However, is still among the leading topics of our time. I appreciate your post and look forward to more.
    www.technewworld.in
    How to Start A blog 2019
    Eid AL ADHA

    ReplyDelete
  79. I am looking for and I love to post a comment that "The content of your post is awesome" Great work!
    Data Science Courses

    ReplyDelete
  80. join and enjoy our domino game here!!

    ReplyDelete
  81. Subsequently, after spending many hours on the 918kiss malaysia trusted company internet at last We've uncovered an individual that definitely does know what they are discussing many thanks a great deal wonderful post.

    ReplyDelete
  82. Thanks for Sharing this useful information. Get SharePoint Development services

    ReplyDelete


  83. Thanks for sharing such a wonderful blog on Python .This blog contains so much data about Python ,like if anyone who is searching for the Python data will easily grab the knowledge of Python from this.Requested you to please keep sharing these type of useful content so that other can get benefit from your shared content.
    Thanks and Regards,
    Top Institutes for Python in Chennai.
    Best Python institute in Chennai .
    Python course in chennai .

    ReplyDelete
  84. Thanks for Sharing this useful information. Get sharepoint apps development from veelead solutions

    ReplyDelete
  85. I am impressed by the information that you have on this blog. It shows how well you understand this subject.
    AI course malaysia

    ReplyDelete
  86. I was just browsing through the internet looking for some information and came across your blog. I am impressed by the informationthat you have on this blog.

    ReplyDelete
  87. Car Maintenance Tips That You Must Follow


    For everyone who owns it, Car Maintenance Tips need to know.
    Where the vehicle is currently needed by everyone in the world to
    facilitate work or to be stylish.
    You certainly want the vehicle you have always been in maximum
    performance. It would be very annoying if your vehicle isn’t even
    comfortable when driving.
    Therefore to avoid this you need to know Vehicle Maintenance Tips or Car Tips
    Buy New Car visit this site to know more.

    wanna Buy New Car visit this site.
    you dont know about Car Maintenance see in this site.
    wanna know about Car Tips click here.
    know more about Hot car news in here.

    ReplyDelete
  88. I just got to this amazing site not long ago. I was actually captured with the piece of resources you have got here. Big thumbs up for making such wonderful blog page!
    rpa training in malaysia

    ReplyDelete
  89. Great Article, I'am Happy to read the whole content of this blog and am very excited.Thanks for sharing these useful information. Keep updating this information!! Machine Learning Course

    ReplyDelete
  90. very nice… i really like your blog. Very useful informations. Thx
    Take a look at Free fortnite gift card codes

    ReplyDelete