java-security

Access HTTPS RESTful service using Web Client in Spring Boot 2.0 throwing exception

…衆ロ難τιáo~ 提交于 2020-05-09 06:16:32
问题 I have to access one https rest web service(https://example.com) for which certificate has been provided by the client which contains 2 .cer files. I have created keystore.jks and truststore.jks files and imported the .cer files to jks file . by using the below command keytool -genkeypair -alias abcd -keyalg RSA -sigalg garegar -keysize 2048 -storetype jks -keystore keystore.jks -validity 365 -storepass changeit keytool -import -alias abcd -trustcacerts -file free/ca_bundle.cer -keystore

need to convert following Signnature verification python code to Android?

喜你入骨 提交于 2020-03-16 07:38:32
问题 I create to python3 application that generate the RSA key pairs. from Crypto.PublicKey import RSA print("--Private Key Generate--") key = RSA.generate(2048) private_key = key.export_key() file_out = open("key/private.pem", "wb") file_out.write(private_key) file_out.close() print("--Public Key Generate--") public_key = key.publickey().export_key() file_out_1 = open("key/receiver.pem", "wb") file_out_1.write(public_key) file_out_1.close() print("key Generated") I sign some data using python and

need to convert following Signnature verification python code to Android?

北城以北 提交于 2020-03-16 07:38:10
问题 I create to python3 application that generate the RSA key pairs. from Crypto.PublicKey import RSA print("--Private Key Generate--") key = RSA.generate(2048) private_key = key.export_key() file_out = open("key/private.pem", "wb") file_out.write(private_key) file_out.close() print("--Public Key Generate--") public_key = key.publickey().export_key() file_out_1 = open("key/receiver.pem", "wb") file_out_1.write(public_key) file_out_1.close() print("key Generated") I sign some data using python and

Java 11 SSL exception: unable to find valid certification path to requested target

风格不统一 提交于 2020-01-22 16:37:18
问题 During an attempt to upgrade one of my applications from java 8 to java 11, I run into a weird SSL exception about "unable to find valid certification" the provisioning of this application overwrites default jdk / jre cacerts with cacerts from ca-certificates-java package so before and after the upgrade, the certificates in the key store should be the same (this is also verified using keytools ): # java 8 ls -l /usr/lib/jvm/java-1.8.0/jre/lib/security/cacerts lrwxrwxrwx 1 root root 41 Sep 11

Crash casting AndroidKeyStoreRSAPrivateKey to RSAPrivateKey

∥☆過路亽.° 提交于 2020-01-22 15:25:02
问题 I'm following this tutorial: How to use the Android Keystore to store passwords and other sensitive information. It (loosely) ties up with the Google Sample app: BasicAndroidKeyStore. I can encrypt my data using the public key, and I can decrypt on devices running Lollipop. However I have a Nexus 6 running marshmallow and this crashes giving the error: java.lang.RuntimeException: Unable to create application com.android.test: java.lang.ClassCastException: android.security.keystore

Crash casting AndroidKeyStoreRSAPrivateKey to RSAPrivateKey

落花浮王杯 提交于 2020-01-22 15:24:12
问题 I'm following this tutorial: How to use the Android Keystore to store passwords and other sensitive information. It (loosely) ties up with the Google Sample app: BasicAndroidKeyStore. I can encrypt my data using the public key, and I can decrypt on devices running Lollipop. However I have a Nexus 6 running marshmallow and this crashes giving the error: java.lang.RuntimeException: Unable to create application com.android.test: java.lang.ClassCastException: android.security.keystore

RC4 related issue after Java 8 update

好久不见. 提交于 2020-01-06 03:16:25
问题 In previous version of Java RC4 was enabled at that time my app worked fine but after Java 8 U 77 update it doesn't any more use the following ciphers which are need to work with one of my legacy servers. TLS_ECDHE_ECDSA_WITH_RC4_128_SHA TLS_ECDHE_RSA_WITH_RC4_128_SHA SSL_RSA_WITH_RC4_128_SHA TLS_ECDH_ECDSA_WITH_RC4_128_SHA TLS_ECDH_RSA_WITH_RC4_128_SHA SSL_RSA_WITH_RC4_128_MD5 I modified the java.security and the disabled algorithm section look like below, jdk.certpath.disabledAlgorithms=MD2

Java: InvalidAlgorithmParameterException Prime size must be multiple of 64

拟墨画扇 提交于 2019-12-28 18:02:51
问题 I implemented a Java program that will connect and execute a command in a remote server using JSCH. The problem is that whenever I tried to connect to the server, I got the following exception: com.jcraft.jsch.JSchException: Session.connect: java.security.InvalidAlgorithmParameterException: Prime size must be multiple of 64, and can only range from 256 to 2048 (inclusive) I tried the solution of adding the Bouncy Castle provider in jre/lib and security.provider and it works. But I need to

Certifying Pdf document with iText

試著忘記壹切 提交于 2019-12-25 03:45:31
问题 I can sign my pdf and verify it by adding my smith.crt to be trusted in adobe reader (i get the green check mark) , my problem is certifying my pdf, i can not get the blue ribbon in the top left corner of my pdf, is it because i use the self-signed certificate? I get the message: The validity of the document certification is UNKNOWN. The author could not be verified. Can you please help me out, how can I get that blue ribbon? import java.io.FileInputStream; import java.io.FileOutputStream;

Convert .cer certificate to .jks

徘徊边缘 提交于 2019-12-20 08:57:36
问题 I need to convert a .cer file to a .jks file. I saw a few questions about it, but haven't seen a solution to what I need. I don't need it in order to add it to my local certificates, but as a file to upload to a server. I also need to do it only once, and not programmatically. There's this thread Converting .cer to .jks using java and the author says he had done it successfully, but I couldn't comment to his last reply as I don't have enough reputation, nor could I send him a personal message