Java學習-050-AES256 之 java.security.InvalidKeyException: Illegal key size or default parameters 解決方案

來源:互聯網
上載者:User

標籤:span   port   provider   exception   network   cep   長度   學習   check   

在進行 Java AES 加密測試時,出現如下錯誤資訊:

java.security.InvalidKeyException: Illegal key size or default parametersat javax.crypto.Cipher.checkCryptoPerm(Cipher.java:1026)at javax.crypto.Cipher.implInit(Cipher.java:801)at javax.crypto.Cipher.chooseProvider(Cipher.java:864)at javax.crypto.Cipher.init(Cipher.java:1249)at javax.crypto.Cipher.init(Cipher.java:1186)

因為超出了JDK 預設的秘鑰長度,若需放開,則需要更新 JDK 中相應的 jar 檔案(local_policy.jar 、US_export_policy.jar),相應的下載連結如下所示:

http://www.oracle.com/technetwork/java/javase/downloads/jce-6-download-429243.html

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

http://www.oracle.com/technetwork/java/javase/downloads/jce8-download-2133166.html

 

請依據相應安裝的 JDK 版本進行下載,下載後解壓到 JDK 安裝目錄下的 jre/lib/security 檔案夾下,重啟應用即可。

 

Java學習-050-AES256 之 java.security.InvalidKeyException: Illegal key size or default parameters 解決方案

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.