keystore

How to build a SSLSocketFactory from PEM certificate and key without converting to keystore?

帅比萌擦擦* 提交于 2019-12-03 13:27:51
问题 I'm given a self-signed client certificate kit that is to be used to access a server via HTTPS. The kit consists of the following PEM files: client.crt (client certificate) client.key (client private key) ca.crt (CA certificate) One way to solve the task is to generate a Java keystore: Use openssl to convert client certificate and key to PKCS12 keystore Use keytool to import CA certificate to the store ... and then use code like the following to build SSLSocketFactory instance: InputStream

Maven Error: (repeated) java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty

試著忘記壹切 提交于 2019-12-03 13:20:40
Have to ask again. Someone thought it was a duplicate question and already answered and removed it from the list. I'm using maven (mvn) batch command with windows (not m2e with eclipse) to run clean install or resolve dependencies. Sometimes, when pom.xml was changed, it is necessary to download artifacts from our nexus server. This used to work for long time for me. But now the connection to the nexus server (https, the server uses a company owned certificate) fails with " java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty " I know, I changed the

Android - Can Publish different Apps with same keystore file in multiple Accounts? [duplicate]

北城以北 提交于 2019-12-03 12:22:10
This question already has answers here : Can I use the same keystore file to sign two different applications? (6 answers) I have uploaded signed apk file with keystore in Client Developer Account . Now i have an another application from the same client with different Developer Account. Can i upload signed apk file with the same keystore file or shall i use new keystore file? Please Help me... Key Store has a collection of digital certificates, which are unique to a publisher, like your signature. They are used to verify that Apps come from a genuine source. Package name + signature combo must

Load MSCAPI Java Keystore without loading private keys (hard token)

為{幸葍}努か 提交于 2019-12-03 11:58:38
问题 I would like to load a MSCAPI keystore within Java and examine available certificates in the MY store. However some keys for those certificates reside on hardware tokens and a popup asks for the token during load. Is there a way to defer loading the private keys when loading the Windows keystore? keyStore = KeyStore.getInstance("Windows-MY", "SunMSCAPI"); keystore.load(null,null); 回答1: The popup is being activated from the MS-CAPI Cryptographic Service Provider (CSP) - the DLL supplied by the

Unable to recreate missing debug keystore?

对着背影说爱祢 提交于 2019-12-03 11:06:27
问题 I'm a newbie to programming in Android, and I just tried to run my build and got this message Execution failed for task ':app:validateDebugSigning'. > Unable to recreate missing debug keystore. What does this mean? I'm using Android Studio. 回答1: I just resolved this same problem, the permissions on my ~/.android folder were wrong. Specifically, Android Studio needs to be able to write to that folder. By default, my installation created that directory as owned by root, and only writable by

keytool import certificate java.util.IllegalFormatConversionException in linux

隐身守侯 提交于 2019-12-03 09:59:05
问题 I am tring to create a keystore to be used in tomcat but I get the error "java.util.IllegalFormatConversionException: d != java.lang.String" using keytool. This happens only in linux (centos7) but not in windows. I created the keystore with keytool -genkey -keyalg RSA -alias client -keystore testkeystore -storepass mypassword -validity 3650 and tried to import the certificate with keytool -import -alias arubaauth -trustcacerts -keystore testkeystore -file root_autenticazione_ATe.cer The same

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

佐手、 提交于 2019-12-03 08:48:49
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("changeit"); config.setTruststoreType("bks"); XMPPConnection connection = new XMPPConnection(connConfig);

Storing a hmac key in Android keystore

孤人 提交于 2019-12-03 08:43:55
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.PrivateKeyEntry privateKeyEntry = (KeyStore.PrivateKeyEntry) keystore.getEntry("temp", null); RSAPublicKey

keytool -genkey error: Keystore file does not exist

天大地大妈咪最大 提交于 2019-12-03 08:17:40
问题 I try to create a new self certified keystore file The command I use is: keytool -genkey -selfcert -dname "cn=My Name, ou=Orga unit" -alias selfcertified -keypass somepass -keystore keystore.jks -storepass anotherpass -validity 365 but I always get this annoying error: keytool error: java.lang.Exception: Keystore file does not exist: keystore.jks I do not understand why I'm getting this error. The command above should create a new keystore, so why is it complaining about a non existing store?

Android - Encode & Decode RSA with Private Key?

我的未来我决定 提交于 2019-12-03 07:54:56
问题 I am trying to encode and decode Strings on Android using a Private Key generated and stored using the Android Key Store Provider that was introduced in Android 4.3 I can successfully generate and get the private key using the following code: private void generatePrivateKey(Activity context, String alias){ /** Generate a new entry in the KeyStore by using the * KeyPairGenerator API. We have to specify the attributes for a * self-signed X.509 certificate here so the KeyStore can attach * the