jce

Using BouncyCastle for a simple HTTPS query

折月煮酒 提交于 2020-01-02 18:56:07
问题 Here's a simplified version of the code I'm using to perform simple HTTPS requests: // Assume the variables host, file and postData have valid String values final URL url = new URL("https", host, file); final HttpURLConnection connection = (HttpURLConnection) url.openConnection(); connection.setRequestMethod("POST"); connection.setDoInput(true); connection.setDoOutput(true); connection.setRequestProperty("Content-length", String.valueOf(postData.length())); final DataOutputStream output = new

Detecting incorrect key using AES/GCM in JAVA

陌路散爱 提交于 2019-12-30 03:33:08
问题 I'm using AES to encrypt/decrypt some files in GCM mode using BouncyCastle. While I'm proving wrong key for decryption there is no exception. How should I check that the key is incorrect? my code is this: SecretKeySpec incorrectKey = new SecretKeySpec(keyBytes, "AES"); IvParameterSpec ivSpec = new IvParameterSpec(ivBytes); Cipher cipher = Cipher.getInstance("AES/GCM/NoPadding", "BC"); byte[] block = new byte[1048576]; int i; cipher.init(Cipher.DECRYPT_MODE, incorrectKey, ivSpec);

bouncycastle + JBoss AS7: JCE cannot authenticate the provider BC

戏子无情 提交于 2019-12-28 03:43:09
问题 I use BouncyCastle for encryption in my application. When I run it standalone, everything works fine. However, if I put it in the webapp and deploy on JBoss server, I get a following error: javax.servlet.ServletException: error constructing MAC: java.security.NoSuchProviderException: JCE cannot authenticate the provider BC (...) root cause java.lang.Exception: error constructing MAC: java.security.NoSuchProviderException: JCE cannot authenticate the provider BC (...) root cause java.io

Microsft Azure installing Java Cryptography Extension (JCE)

拟墨画扇 提交于 2019-12-25 07:26:25
问题 I have a Java 8 Wep App on Azure. I am using the default JRE build in application settings for the webapp. I am running on Tomcat. I am having trouble installing Java Cryptography Extension to handle some encryption. I dont have access to Java Home to install it, I can only upload the WAR files to web app. Does anyone know how to install JCE on Azure? Thanks! Fab 回答1: For people who are still having trouble with this I share my solution by example: Copy JDK from D:\Program Files (x86)\Java

Getting error while sending Push Notification to iPhone using Java-PNS?

我们两清 提交于 2019-12-25 05:16:31
问题 I am using javaPNS_2.2.jar file to send push notification message to iPhone device. My Code is: PushNotificationPayload payload = PushNotificationPayload.complex(); /* Customize the payload */ payload.addAlert("Hello World!"); payload.addCustomDictionary("mykey1", "My Value 1"); payload.addCustomDictionary("mykey2", 2); /* Push your custom payload */ String keystore = "C:/1.0Eywa_Baba/PushNotificationKey.p12"; String password = "Eywa@12"; boolean production = false; String devices = "C81DD339

Java Error: please install JCE Unlimited Strength Jurisdiction Policy files

别来无恙 提交于 2019-12-24 01:12:57
问题 I am working on this Java application which needs to have access to "JCE Unlimited Strength" files and I DO HAVE installed them and it works properly when I build the solution (in Intellij) BUT when I make a jar output, for some reason it gives me this annoying error: C:\Users\h\whatever\out\artifacts\Accepter_jar>java -cp Accepter.jar Main org.apache.poi.EncryptedDocumentException: Export Restrictions in place - please install JCE Unlimited Strength Jurisdic tion Policy files at org.apache

JCE Unlimited Strength installed but AES 256 is not supported

时间秒杀一切 提交于 2019-12-21 06:44:49
问题 I have installed JCE Unlimited strength to JAVA_HOME\lib\security However, I'm still getting 128 for Cipher.getMaxAllowedKeyLength("AES") . I'm wondering if I have installed the JCE at the wrong place. I have Java installed in 2 places. C:\Program Files\Java\jre7 C:\Development\Java\jdk1.6.0_21 Can anyone tell me where is the correct place to install JCE Unlimited strength? Your help is much appreciated. my code: KeyGenerator generator = KeyGenerator.getInstance("AES"); generator.init(256);

Using openssh public key (ecdsa-sha2-nistp256) with Java Security

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-20 04:47:27
问题 Is there a Java library/example to read an openssh format ecdsa public key to a JCE PublicKey in Java? I want to use EC for JWT . The format I'm trying to read is as per authorized_keys, or Github API (e.g. https://api.github.com/users/davidcarboni/keys): ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBK8hPtB72/sfYgNw1WTska2DNOJFx+QhUxuV6OLINSD2ty+6gxcM8yZrvMqWdMePGRb2cGh8L/0bGOk+64IQ/pM= I've found this answer, which is fine for RSA and DSS: Using public key from

Using openssh public key (ecdsa-sha2-nistp256) with Java Security

自闭症网瘾萝莉.ら 提交于 2019-12-20 04:47:18
问题 Is there a Java library/example to read an openssh format ecdsa public key to a JCE PublicKey in Java? I want to use EC for JWT . The format I'm trying to read is as per authorized_keys, or Github API (e.g. https://api.github.com/users/davidcarboni/keys): ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBK8hPtB72/sfYgNw1WTska2DNOJFx+QhUxuV6OLINSD2ty+6gxcM8yZrvMqWdMePGRb2cGh8L/0bGOk+64IQ/pM= I've found this answer, which is fine for RSA and DSS: Using public key from

Encrypting data with Objective-C and decrypt it with Java Problem

寵の児 提交于 2019-12-18 13:48:17
问题 I have an iPhone solutions that uses XML to transmit data between the client (mobile) and the server (Java). Some of the parts of the message (XML) must be encrypted because of the type of information transmitted. I planned to use AES 128 to encrypt and decrypt the data between these two endpoints. First the sensitive data is encrypted using Object-C's CommonCrypto framework, and then the data is decrypted inside a Java Server (Servlet). I'm new to security protocols and standards, and