keystore

Invalid keystore format

最后都变了- 提交于 2019-12-08 10:04:57
问题 I was given a keystore file along with an username and password and I need to sign the updated application. However, I am getting "keytool error: java.io.IOException: Invalid keystore format" when trying to list the contents of the file, trying to create a new key in the keystore, etc. I have looked at the similar posts, but none of them helped me. I am looking forward to hearing a solution. Thanks in advance 回答1: It turned out that the file was an RAR archive file that contained the actual

Use JNA to get Local machine Certificate

时光怂恿深爱的人放手 提交于 2019-12-08 09:23:38
问题 I'm trying to get a certificate from local machine Windows store. What a want to get is a certificate in the patth "Certificates(Local Computer) --> Personal --> Certificates". I used this code to access certificate in the path "Certificates - Current User --> Personal --> Certificates NativeLibrary crypt32 = NativeLibrary.getInstance("Crypt32"); Function functionCertOpenSystemStore = crypt32.getFunction("CertOpenSystemStoreA"); Object[] argsCertOpenSystemStore = new Object[] { 0, "MY"};

Keys lost from BKS file without deleteKey command

核能气质少年 提交于 2019-12-08 05:22:40
问题 I use a keystore (BKS format) in my android app to store public private keypairs. The app was used over a long time and had 10+ public private key pairs. All of a sudden, one of the app's major functionality stopped working. Root cause was found out to be the following: Only one public private keypair is remaining in the BKS file. All other keypairs are lost. I verified in the code that KeyStore.deleteEntry(alias) is not called anywhere in the app. The only place where I could find if

How to instantiate X509Certificate from a P12 file in Blackberry

拟墨画扇 提交于 2019-12-08 05:20:40
问题 I have a valid P12 file. I need to instantiate an X509certificate object, so that I can use it as a client side certificate. I realize that there is already a similar question answered here, How to instantiate javax.security.X509Certficate object from a p12 certificate (contains certificate + private key) But in Blackberry, the getInstance(String) method is not available for KeyStore. It's available for DeviceKeyStore and TrustedKeyStore. But we can't pass the "PKCS12" parameter to the

Using SSL certificate for signing PDF files

点点圈 提交于 2019-12-08 03:16:54
问题 I have a SSL certificate for my application and I want to use it for digitally signing PDF files using iText. The extension of the certificate is .cer and is provided by a certificate signing authority (CA). The problem is that I am not able to convert this .cer certificate into java keystore which is required while signing the PDF using itext library. The code that I have is: This code obviously throws Invalid keystore format IOException. KeyStore ks = KeyStore.getInstance(KeyStore

Creating keystore BKS for https android connection

元气小坏坏 提交于 2019-12-08 03:15:17
问题 I found tutorial which describes how create and use keystore for https connection. But I have very noob question: where should i put this code to create keystore? at the openssl command promt or in keytool key prompt. export CLASSPATH=bcprov-jdk16-145.jar CERTSTORE=res/raw/mystore.bks if [ -a $CERTSTORE ]; then rm $CERTSTORE || exit 1 fi keytool \ -import \ -v \ -trustcacerts \ -alias 0 \ -file <(openssl x509 -in mycert.pem) \ -keystore $CERTSTORE \ -storetype BKS \ -provider org.bouncycastle

Checking for CA's certificate before entering a certificate?

旧城冷巷雨未停 提交于 2019-12-07 18:48:11
问题 I am inserting a client certificate into my servertruststore using following code FileInputStream fileInputStream = new FileInputStream( "c:/server.jks" ); keyStore.load( fileInputStream, "keystore".toCharArray() ); fileInputStream.close(); keyStore.setCertificateEntry( alias, new X509Certificate( trustedCertificate ) ); FileOutputStream fileOutputStream = new FileOutputStream("c:/server.jks" ); keyStore.store( fileOutputStream, "keystore".toCharArray() ); fileOutputStream.close(); Now i see

How to find ~/.android/debug.keystore in Mac OS X for Android?

余生长醉 提交于 2019-12-07 18:23:34
问题 I am very new to Android development. Now am facing this problem in Java Eclipse, Error generating final archive: Debug Certificate expired on 1/11/12 12:52 PM Unknown Android Packaging Problem I searched in google and found the answer for my problem from this link "Debug certificate expired" error in Eclipse Android plugins. They gave the answer for my question. I am using Eclipse in Mac OS X . They gave solution that to delete debug.key from Preferences - Android - Build - Default debug

ECDH using Android KeyStore generated private key

依然范特西╮ 提交于 2019-12-07 12:06:38
问题 I'm trying to implement ECDH in Android using a private generated by Android KeyStore Provider. public byte[] ecdh(PublicKey otherPubKey) throws Exception { try { ECPublicKey ecPubKey = (ECPublicKey) otherPubKey; KeyAgreement keyAgreement = KeyAgreement.getInstance("ECDH"); PrivateKey pk = (PrivateKey) LoadPrivateKey("Backend"); keyAgreement.init(pk); keyAgreement.doPhase(ecPubKey, true); return (keyAgreement.generateSecret()); } catch (Exception e) { Log.e("failure", e.toString()); return

Is it possible to install existing private key and ssl certificate in a new keystore?

帅比萌擦擦* 提交于 2019-12-07 11:00:21
问题 We have lost our original keystore used to generate the CSR during a server failure. We have a backup of the private key (.key file) and the original CSR (.csr file). Is it possible to reconstruct the keystore with those? Since all the instructions for creating the certificate chains require the original keystore. This is for use with Tomcat 7.0.27. Thanks 回答1: Yes, that should be possible. But in addition to the private key you will also need the certificate (not csr) that was returned by