keytool

com.facebook.FacebookAuthorizationException: UnknownError: Key hash does not match any stored key hashes

邮差的信 提交于 2019-12-03 21:13:43
I am a lot of time try to connect my android app with facebook but get excaption with the hash key. I read question here about this but didn succes to solve my problem I run this code to get hash key try { PackageInfo info = getPackageManager().getPackageInfo( "com.example.fishe", PackageManager.GET_SIGNATURES); for (Signature signature : info.signatures) { MessageDigest md = MessageDigest.getInstance("SHA"); md.update(signature.toByteArray()); Log.d("com.example.fishe", Base64.encodeToString(md.digest(), Base64.DEFAULT)); } } catch (NameNotFoundException e) { } catch (NoSuchAlgorithmException

Maps v2 API Key on Android

柔情痞子 提交于 2019-12-03 21:06:14
I went to https://code.google.com/apis/console/ I then did this: keytool -v -list -alias ks_ms_ad -keystore W:\eclipse-android-sign\keystore\exampleproject I converted the output SubjectKeyIdentifier [ KeyIdentifier [ 0000: HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH H /x<s7.@...B.).8. 0010: HH HH HH HH .. . ] ] to HH:HH:HH:HH:HH:HH:HH:HH:HH:HH:HH:HH:HH:HH:HH:HH:HH:HH:HH:HH;com.exampledomain.exampleproject Google actually accepted this, so somehow I turned gibberish into something usable. The "HH" entries matched up with the example given in Google's API console site, so there is a small

'peer not authenticated' SSL certificate error usng DefaultHttpClient

☆樱花仙子☆ 提交于 2019-12-03 20:39:14
I have an application jar from which I m calling an HTTPS url using DefaultHTTPClient class object but its giving peer not authenticate exception , so I want to sign jar using keystore. I have .cer file which has public key and I can able to import into keystore but when I use jarsigner tool it says certificate chain not found.you must have private key and associate public key. I have .pfx file also which is suppose to an private key but I don't know how to import it.can any one able to tell me the steps how to import .pfx file and use in jarsigner. Correct me if I m wrong somewhere.. UPDATE

How can I generate a key pair and insert it into a KeyStore programmatically (without using the Java KeyTool)?

假装没事ソ 提交于 2019-12-03 20:10:26
I would like to generate a key pair and insert it into a Java KeyStore programmatically. I can use the command line to do exactly what I want, but how to do that using Java code? Here is the command line: keytool -genkeypair \ -dname "cn=Unknown" \ -alias main \ -keyalg RSA \ -keysize 4096 \ -keypass 654321 \ -keystore C:\\Users\\Felipe\\ks \ -storepass 123456 \ -validity 365 Here is the Java code I have so far: public static void main(String[] args) { try ( FileOutputStream fos = new FileOutputStream("C:\\Users\\Felipe\\ks"); ) { KeyPairGenerator keyPairGenerator = KeyPairGenerator

tomcat https ssl测试

时光怂恿深爱的人放手 提交于 2019-12-03 19:22:41
1、在命令行中进入%CATALINA_HOME%/bin目录下执行以下命令: (1)%CATALINA_HOME%/bin> keytool -genkey -alias tomcat -keyalg RSA -keypass changeit -storepass changeit -keystore server.keystore -validity 3600 此时会在%TOMCAT_HOME%/bin下生成server.keystore 文件。 注:参数 -validity 指证书的有效期(天),缺省有效期很短,只有90天。 (2)%CATALINA_HOME%/bin> keytool -export -trustcacerts -alias tomcat -file server.cer -keystore server.keystore -storepass changeit 这一步用于导出证书,此时会在%TOMCAT_HOME%/bin下生成server.cer 文件。 (3)%CATALINA_HOME%/bin> keytool -import -trustcacerts -alias tomcat -file server.cer -keystore %JAVA_HOME%/jre/lib/security/cacerts -storepass changeit

keytool error: java.lang.Exception: Failed to establish chain from reply

余生颓废 提交于 2019-12-03 17:58:15
问题 Generate keystore: keytool -genkey -alias tomcat -keyalg RSA -keystore my.keystore -keysize 2048 Generate certificate signing request (CSR): keytool -certreq -alias tomcat -keyalg RSA -file my.csr -keystore my.keystore I then go off to my hosting provider and get some certificates. These i installed as follows: keytool -import -alias root -keystore my.keystore -trustcacerts -file gd_bundle-g2-g1.crt keytool -import -alias intermed -keystore my.keystore -trustcacerts -file gdig2.crt keytool

openssl fails to produce a pfx with a valid alias

╄→гoц情女王★ 提交于 2019-12-03 17:15:31
问题 I am trying to generate a pfx file to use as a signing mechanism for some JAR files as per these instructions. To create the pfx file I am using the following command openssl pkcs12 -export -in my-cert.crt -inkey my-priv-key.key -certfile my-ca-bundle -out my-pfx.pfx This command successfully generates me a pfx file, however, when I try to find the alias using the following command keytool -list -storetype pkcs12 -keystore my-pfx.pfx -v | grep Alias I get the following response Alias name: 2

Android signing error: trusted certificate entries are not password-protected

风格不统一 提交于 2019-12-03 16:40:32
问题 Got a certificate to sign the android unsigned release apk files, So I imported the cer using command: keytool -import -alias alias_name -file cer_name.cer -storepass changeit -keystore my_keystore.keystore But when signing the app with android studio it produces error: Error:Execution failed for task ':packageDebug'. > com.android.ide.common.signing.KeytoolException: Failed to read key alias_name from store "C:\Users\username\my_keystore.keystore": trusted certificate entries are not

Only RSAPrivate (Crt) KeySpec and PKCS8EncodedKeySpec supported for RSA private keys

假装没事ソ 提交于 2019-12-03 16:28:53
I following the steps from the link : How to read .pem file to get private and public key . I executed the following three commands: 1. $openssl genrsa -out mykey.pem 2048 2. $openssl pkcs8 -topk8 -inform PEM -outform PEM -in mykey.pem -out private_key.pem -nocrypt 3. $ openssl rsa -in mykey.pem -pubout -outform DER -out public_key.der This created three files, but when I was trying to read those through Java code I started facing below error: PUBLIC KEY EXPO : 65537 Only RSAPrivate(Crt)KeySpec and PKCS8EncodedKeySpec supported for RSA private keys My code for reference: public class

jarsigner -verify works in Java 6 but not Java 7

余生颓废 提交于 2019-12-03 15:29:04
I've been banging my head against this for a few days and am completely stumped. Here's the rundown: I've got an Eclipse plugin project using Tycho to build via Maven 3 Within Maven I've got the maven-jarsigner-plugin set up to sign jars using my keystore (see below for keystore details) I've got a code signing cert that's been signed by Thawte in my keystore I can take any signed jar file from target/* and run 'jarsigner -verify' on it. This is what happens: #java 6 on a VM vagrant@test2:/vagrant/com.example.plugins.eclipse/target$ jarsigner -verify com.example.eclipse-0.1.3-SNAPSHOT.jar jar