keytool

使用keytool管理数字证书

喜欢而已 提交于 2019-12-10 02:39:43
keytool是Java的数字证书管理工具,用于数字证书的生成,导入,导出与撤销等操作。它与本地密钥库关联,并可以对本地密钥库进行管理,可以将私钥存放于密钥库中,而公钥使用数字证书进行输出。keytool在jdk安装目录的bin文件夹下: 构建自签名证书 在构建CSR之前,需要先在密钥库中生成本地数字证书,此时需要提供用户的身份、加密算法、有效期等一些数字证书的基本信息: keytool -genkeypair -keyalg RSA -keysize 1024 -sigalg MD5withRSA \ -validity 365 -alias www.mydomain.com -keystore ~/my.keystore 参数介绍: -genkeypair——产生密钥对 -keyalg ——指定加密算法 -keysize ——指定密钥长度 -sigalg ——指定签名算法 -validity ——证书有效期 -alias ——证书别名 -keystore ——指定密钥库的位置 执行结果: 证书导出 执行了上面的命令后,我们已经生成了一个本地数字证书,虽然还没有经过证书认证机构进行认证,但并不影响使用,我们可以使用相应的命令对证书进行导出。 keytool -exportcert -alias \ -keystore ~/my.keystore -file /tmp/my.cer

Weblogic安装SSL证书指南

萝らか妹 提交于 2019-12-10 02:01:34
一、 生成证书请求 1. 安装JDK(可选) Weblogic安装后自带JDK安装。如果您直接在服务器上生成证书请求,请进入Weblogic安装目录下JDK所在路径的bin目录,运行keytool命令。 如果您需要在其他环境下生成证书请求文件,则您可以选择安装JDK,并稍后上传生成的密钥库文件keystore.jks到服务器上进行配置。 Java SE Development Kit (JDK) 下载。下载地址: http://www.oracle.com/technetwork/java/javase/downloads/index.html 2. 生成keystore文件 生成密钥库文件keystore.jks需要使用JDK的keytool工具。命令行进入JDK或JRE下的bin目录,运行keytool命令(示例中粗体部分为可自定义部分,请根据实际配置情况作相应调整)。 keytool -genkey -alias server -keyalg RSA -keysize 2048 -keystore C:\keystore.jks -storepass password -keypass password 以上命令中,server为私钥别名(-alias),生成的keystore.jks文件默认放在命令行当前路径下。 3. 生成证书请求文件(CSR) SHA1请使用:

Android studio打包签名apk的bug们

六眼飞鱼酱① 提交于 2019-12-10 01:24:08
先吐槽一句,AndroidStudio真心是我碰壁最多的软件,也不知道怎么这么多障碍找上我了。。。 用as打包apk网上有很多教程,比如 这位博主 提到的方法,也是最正常简单的方式。但是! 列举一下遇到的各种问题吧。 JKS 密钥库使用专用格式。建议使用 “keytool -importkeystore -srckeystore jhy-release-key.jks -destkeystore jhy-release-key.jks -deststoretype pkcs12” 迁移到行业标准格式 PKCS12 解决 :我是没管这个warning的,因为我试了它提示的keytool命令,但是出现了getlength什么的新错误,所以干脆不改了。 使用以上链接中步骤打包后没有签名,提示jar not signed巴拉巴拉 解决 :从这里开始我就没再用AS了,简直坑我。。就使用命令行的方式吧,轻松快捷: 在build完之后 :(1)生成签名文件的命令: keytool -genkey -v -keystore 签名文件.jks -keyalg RSA -keysize 2048 -validity 10000 -alias 别名(随便起但是要记住) 之后需要填一些信息,可以随便填但是至少要填一个才行。 (2)对build之后的apk进行签名: jarsigner -verbose

Keytool set hostname

痴心易碎 提交于 2019-12-10 01:06:34
问题 I am just attempting to use the java keytool but I cannot figure out how to set the hostname. This is what is how I am attempting: hostname[username:/this/is/a/path][640]% keytool -keystore server.keystore -genkeypair -alias hostname Enter keystore password: Re-enter new password: What is your first and last name? [Unknown]: hostname What is the name of your organizational unit? [Unknown]: hostname What is the name of your organization? [Unknown]: hostname What is the name of your City or

Permission error when importing certificate to cacerts

我的未来我决定 提交于 2019-12-09 18:01:10
问题 I need to import a certificate for some maven repositories into the global keystore. The certificate file is named maven.crt so the command I am running is keytool -import -keystore $JAVA_HOME/jre/lib/security/cacerts -trustcacerts -alias maven -file maven.crt It asks me for password and then if I trust the certificate to which I answer yes This is the final output Certificate was added to keystore keytool error: java.io.FileNotFoundException: /usr/java/jdk1.7.0_40/bin/java/jre/lib/security

Trying to refresh 'expired' keystore

独自空忆成欢 提交于 2019-12-09 17:18:10
问题 I am trying to re-sign some jars using the ant task 'signjar' however it's telling me "The signer certificate has expired." So I tried to re-generate the keystore hoping this would 'un-expire' it... keytool -genkey -keystore mykeystore -alias myalias but after entering the keystore password i get: "keytool error: java.lang.Exception: Key pair not generated, alias already exists" what am i doing wrong? do i need to delete the keystore to re-generate it or is there a simple way to refresh it so

Maps v2 API Key on Android

假装没事ソ 提交于 2019-12-09 13:48:29
问题 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.

Using a self-signed certificate

走远了吗. 提交于 2019-12-09 11:59:30
问题 I am just trying to get my head around SSL. I have set up a Jetty server on my localhost, and generated my own certificate using Keytool. Now when I go to https://localhost:8443/ I get the can't trust this certificate error. I use keytool -export -alias pongus -keystore keystore -file certfile.cer To create the certificate which I think is what the client needs to authenticate with the server. (This is where I could be very wrong!) I have the following ruby code : require 'net/https' require

Google maps not showing on android in release mode

非 Y 不嫁゛ 提交于 2019-12-08 19:10:30
问题 I am trying to release my app, but having a problem with google maps. The app contains an activity (MapActivity) that displays a map. When running in debug mode, the map works fine. I signed my app in release mode, and got SHA1. I created a new android key on Google console as required (SHA1;packageName). Got the API Key In my App, I referenced a copy of google-play-services-lib as required. I am using ADT. map.xml <?xml version="1.0" encoding="utf-8"?> <fragment xmlns:android="http://schemas

How to reset keystores when you do not know their password?

佐手、 提交于 2019-12-08 17:09:41
问题 For some reason I got this message: keytool error: java.io.IOException: Keystore was tampered with, or password was incorrect I know that I cannot "repair" the keystore, but I want to reset the keystore, but don't know how to do it, especially because I do not know the location of the default keystores. Note: I just want the "blank" them so I restart from default. Still I wasn't even able to detect their location. How can I list default keystores and their locations with keytool or something