security.provider.1=sun.security.provider.Sunsecurity.provider.2=sun.security.rsa
.SunRsaSignsecurity.provider.3=sun.security.ec.SunECsecurity.provider.4=com.sun.n et.ssl.internal.ssl.Providersecurity.provider.5=com.sun.crypto.provider.SunJCEsec urity.provider.6=sun.security.jgss.SunProvidersecurity.provider.7=com.sun.securit y.sasl.Providersecurity.provider.8=org.jcp.xml.dsig.internal.dom.XMLDSigRIsecurit y.provider.9=sun.security.smartcardio.SunPCSCsecurity.provider.10=sun.security.ms capi.SunMSCAPI
Keyin qo'shish kerak:
security.provider.11 = org.bouncycastle.jce.provider.BouncyCastleProvider Iltimos, seriya raqami sizning xavfsizlik faylingizga bog'liqligini unutmang.
O'rnatish muvaffaqiyatli bo'lganligini tekshirish uchun quyidagi oddiy dasturdan foydalanishingiz mumkin: public static void main (String [] args) {Provider provider
= Security.getProvider ("BC"); System.out.println (provayder);} Agar null qaytarsa o'rnatish muvaffaqiyatsiz tugaganligini bildiradi. Agar BC sifatida ko'rsatilgan bo'lsa, o'rnatish muvaffaqiyatli bo'ldi.
Java importini boshqarish bo'yicha cheklovlar olib tashlandi.
Chet elga olib kirish va eksport qilish cheklovlari tufayli Java Kriptografik Algoritm Tizimi ba'zi cheklovlarga duch keladi. Cheklovlarni olib tashlash uchun siyosat fayli qaytadan yozilishi kerak.
Siyosat faylini yuklab oling
jdk6 ->http: //www.oracle.com/technetwork/java/javase/downloads/jce-6- download-429243.html
jdk7 -> http: //www.oracle.com/technetwork/java/javase/downloads/jce-7- download-432124.html
jdk8 -> http: //www.oracle.com/technetwork/java/javase/downloads/jce8- download-2133166.html
Yuklangan siyosat fayliga ikkita fayl kerak bo'ladi: local_policy.jarcUS_export_policy.jar
sdk va jre-dagi ikkita siyosat faylini qayta yozing.
Sinov
Agar siyosat fayli samarali bo'lsa, tekshirish uchun quyidagi protseduradan foydalanishingiz mumkin:
AES algoritmining cheklovi olib tashlanishidan oldin, AES algoritmi faqat 128 bitni qo'llab-quvvatlagan.
public static void main(String[] args) { try {
KeyGenerator kg = KeyGenerator.getInstance("AES"); kg.init(256);
SecretKey secretKey = kg.generateKey(); System.out.println(secretKey.getFormat());
} catch (NoSuchAlgorithmException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
Agar java.security.InvalidKeyException: Illegal key error yuzaga kelsa, bu cheklov bekor qilinmaganligini anglatadi.
|