keystore

Using the Android TrustStore for aSmack in Android 4+ (ICS)

不问归期 提交于 2019-12-04 14:08:53
问题 I am not an expert on keystores and have a hard time understanding the nuances of this but this is how far I got: In creating a xmpp-connection using the asmack build found here one still has to change the truststore, which usually, so say multiple sources on the web, is done using these commands ConnectionConfiguration config = new ConnectionConfiguration(host, Integer.parseInt(port), service); config.setTruststorePath("/system/etc/security/cacerts.bks"); config.setTruststorePassword(

Storing a hmac key in Android keystore

白昼怎懂夜的黑 提交于 2019-12-04 14:08:40
问题 I am using the below code to create a hmac key and returning it as a string. KeyGenerator keyGen = null; try { keyGen = KeyGenerator.getInstance("HmacSHA256"); } catch (NoSuchAlgorithmException e) { e.printStackTrace(); } SecretKey key = keyGen.generateKey(); byte[] encoded = key.getEncoded(); String s=Base64.encodeToString(encoded, Base64.DEFAULT); Log.i("Hmac key before encrypt",s); try { KeyStore keystore = KeyStore.getInstance("AndroidKeyStore"); keystore.load(null, null); KeyStore

Generating a BKS keystore and storing app key

谁都会走 提交于 2019-12-04 13:01:10
I am supposed to create a BKS keystore and store a private Application key which is a 48 character long string in this Keystore. I also have a JCEKS keystore which has this key value already in it. If I try to convert into BKS type keystore using portecle tool, the Key entry is lost. I am new to JCE. Can someone please guide me as to what needs to be done to import this Key in the Keystore? Thanks. Try this command keytool -importcert -v -trustcacerts -file "cacert.pem" -alias ca -keystore "mySrvTruststore.bks" -provider org.bouncycastle.jce.provider.BouncyCastleProvider -providerpath "bcprov

Configuration issue for Spray https server with self-signed certificate?

与世无争的帅哥 提交于 2019-12-04 11:57:34
问题 I am using Spray 1.3, Akka 2.3, and Scala 2.11 on Mac 10.9.4 to set up an HTTP server. I am following the Ch. 2 example in Manning's Akka in Action (sample code available here: https://github.com/RayRoestenburg/akka-in-action.git), which compiles, runs, and behaves as expected when I use http, but I am having trouble configuring it for use with https. To run with https, I have generated a self-signed certificate as follows: keytool -genkey -keyalg RSA -alias selfsigned -keystore myjks.jks

Sun Java KeyManagerFactory and null passwords

喜夏-厌秋 提交于 2019-12-04 11:39:13
问题 We are having a problem with the KeyManagerFactory in the Sun JRE 1.6. We are using code similar to the following to upload and use a certificate in p12 format: KeyStore keyStore = KeyStore.getInstance(PKCS12); KeyManagerFactory keyManagerFactory = KeyManagerFactory.getInstance(SUN_X509); InputStream certificateFile = getSSLCertificate(); String certificatePassword = getSSLCertificatePassword(); keyStore.load(certificateFile, certificatePassword); keyManagerFactory.init(keyStore,

java sending keystrokes using robot class

大城市里の小女人 提交于 2019-12-04 09:35:55
问题 I know it's possible to send keystrokes in java using Robot Class , but is there any way to specify the target process when it's already started ? 回答1: The Robot will send the keystrokes to whichever application window is on top. To send keystrokes to a specific target, you will want to set the target as the platform's foreground window first. Doing this may require native code such as that provided by JNI or (what I use) JNA. If you desire to send keystrokes to a background window, I believe

Can't change the keystore format

ε祈祈猫儿з 提交于 2019-12-04 08:42:27
问题 I'm trying to make some keystores using keytool from the latest JRE (version 1.8.0_151). When I create the keystore using this command keytool -genkey -alias serverprivate -keystore server.private -keyalg rsa -storepass apassword -keypass apassword it shows me this warning: Warning: The JKS keystore uses a proprietary format. It is recommended to migrate to PKCS12 which is an industry standard format using "keytool -importkeystore -srckeystore server.private -destkeystore server.private

java - how to store a key in keystore

徘徊边缘 提交于 2019-12-04 08:06:00
问题 I've need to store 2 keys into KeyStore Here's the relevant code: KeyStore ks = KeyStore.getInstance("JKS"); String password = "password"; char[] ksPass = password.toCharArray(); ks.load(null, ksPass); ks.setKeyEntry("keyForSeckeyDecrypt", privateKey, null, null); ks.setKeyEntry("keyForDigitalSignature", priv, null, null); FileOutputStream writeStream = new FileOutputStream("key.store"); ks.store(writeStream, ksPass); writeStream.close(); Though I get an execption "Private key must be

Have keystore password, lost key to sign Android app [duplicate]

前提是你 提交于 2019-12-04 06:15:19
问题 This question already has answers here : I lost my .keystore file? (11 answers) Closed 3 years ago . I've seen a lot of posts about losing keystore passwords, but I have my keystore password but lost a private key password. Now, I can't sign using that key, which is required to update my app. Is there anything I can do? 回答1: No, there is nothing you can do. The apk must be signed with the exact same keystore and profile within the keystore. You cannot simply generate another one with the same

How to add SSL certificates to Tomcat in Docker container?

可紊 提交于 2019-12-04 05:02:51
I'm new to Docker and trying to learn it. I'm using Docker Quickstart Terminal on Windows 7. I've a simple requirement where I'm using Tomcat in a Docker container. My DockerFile is as following: FROM tomcat:8.0.47-jre7 RUN cd /usr/local/tomcat/webapps COPY test.war /usr/local/tomcat/webapps/test.war Then I issue simple build and run commands in the Docker console. test.war is a Java web-service. This web-service internally calls other web-services on remote hosts using HTTPS. I've the certs for the remote hosts. I tried several ways available on the internet to import or copy those certs to