keystore

What is the best way to generate Certificate Signing Request using AndroidKeyStoreProvider?

大憨熊 提交于 2020-07-30 05:37:28
问题 I read this article. It says how to generate a KeyPair , however it doesn't specify how to generate a Certificate Signing Request based on the generated keys. From my research, to generate a CSR in Java, the samples from the web usually use the package sun.* or the BouncyCastle library. It seems like there isn't a way to generate a CSR with the standard java.security API. I read this and it seems to say the same thing. Do I have no choice but to use BouncyCastle? It is hard to imagine that

Convert .pem files to .jks

╄→尐↘猪︶ㄣ 提交于 2020-07-24 04:34:50
问题 I received the two private RSA keys in my mail and I copied and saved it as validator.pem and user.pem which I used to connect to remote server. This is working. Now, I need to convert them to .jks files, but I get the following errors: java.lang.Exception: Input not an X.509 certificate validator.pem -----BEGIN RSA PRIVATE KEY----- -----END RSA PRIVATE KEY----- ---------------------------------------------------------- user.pem -----BEGIN RSA PRIVATE KEY----- -----END RSA PRIVATE KEY-----

Convert .pem files to .jks

╄→гoц情女王★ 提交于 2020-07-24 04:31:27
问题 I received the two private RSA keys in my mail and I copied and saved it as validator.pem and user.pem which I used to connect to remote server. This is working. Now, I need to convert them to .jks files, but I get the following errors: java.lang.Exception: Input not an X.509 certificate validator.pem -----BEGIN RSA PRIVATE KEY----- -----END RSA PRIVATE KEY----- ---------------------------------------------------------- user.pem -----BEGIN RSA PRIVATE KEY----- -----END RSA PRIVATE KEY-----

How do I import an existing Java keystore (.jks) file into a Java installation?

≡放荡痞女 提交于 2020-06-22 04:56:28
问题 So, I am having trouble with LDAP. I have an integration test case that hopefully will work out, but it is currently running into LDAPS security issues with the SSL handshake. I am able to connect to the LDAPS with Apache Directory Studio, and it has downloaded the keystore into a file "permanent.jks". That's ok, but I want my integration test, which resides in Eclipse using a JRE, to be able to connect to the LDAP server using this keystore. How can I take this keystore and import it into

hiding keystore password from process list

浪子不回头ぞ 提交于 2020-06-01 04:07:07
问题 I have a Linux server and a java application. I am using Java 1.7 to run this application. I want to enable JMX for monitoring purposes. The JMX connection should be secured by SSL. So far so easy. My problem: How do I tell the jvm the keystore-password in a secure way? So far the ssl connection only works if I pass the password over the command line parameter "-Djavax.net.ssl.keyStorePassword=mypwd". It seems that the password must be set on initialising of the jvm. If I am looking at the

Extract certificate from SSLContext

别等时光非礼了梦想. 提交于 2020-04-11 04:44:07
问题 I'm creating SSLContext in standard way: take .p12 certificate file, create KeyStore and load certificate into it, create KeyManagerFactory, init it with KeyStore, and get KeyManagers, create TrustManagerFactory, init it with null, and get TrustManagers. create SSLContext and init it with KeyManagers and TrustManagers. The question is - how can I extract KeyStore and certificate data back from SSLContext? The task is to obtain fingerprint hash from certficate. Is it even possible or I have to

Android, Generate Digital Asset Link: keystore file for signing the app

六月ゝ 毕业季﹏ 提交于 2020-03-25 19:09:45
问题 I implemented universal linking for my Android app. Everything works fine so far. I click on a universal link and will be immediately redirected to the app. However, I have always used debug for the Digital Asset Links . For the release I need the signing config or the keystore file. To sign my app I always use a created xxxx.jks file. If I specify this, an error occurs: Error occured while trying to get the SHA-256 fingerprint (See screenshot). The error is very meaningless. That's why I'm a

Export PublicKey and PrivateKey from PKCS12 file

我们两清 提交于 2020-03-22 07:21:12
问题 I have a .p12 file and I want to export a public and private keys. I used this method: FileInputStream fm = new FileInputStream("C:\\cert.p12"); KeyStore ks = KeyStore.getInstance("PKCS12"); try { ks.load(fm, "pass".toCharArray()); } catch (Exception e) { e.printStackTrace(); } Key key = ks.getKey("cert", "pass".toCharArray()); Certificate cert = ks.getCertificate("cert"); PublicKey publicKey = cert.getPublicKey(); System.out.println("Public key"); System.out.println(Base64.getEncoder()