标签: keytool

AndroidDebugKey密钥库被篡改,或密码不正确

每当我进入终端时:

keytool -list -alias androiddebugkey -keystore~/.android/debug.keystore -storepass android -keypass android

它要我输入密码.我以前从未设置过密码.我已经阅读了其他地方放入"android",但我仍然收到以下错误:

keytool错误:java.io.IOException:Keystore被篡改,或密码不正确

我也是Mac环境的新手.每当我输入密码时,光标都不会移动.我不确定这是否是隐藏密码的默认Mac行为,或者密码是否未注册,这就是我收到错误的原因.任何帮助表示赞赏.

java android google-maps keystore keytool

14
推荐指数
1
解决办法
2万
查看次数

在Mac上找不到keytool

我正在尝试找到我的keytool,以便我可以创建密钥来签署我的应用程序并注册google maps api

我开始认为我的机器上并没有它

如果有人能帮助我指出正确的方向,这将是伟大的

macos android keystore keytool google-maps-api-3

14
推荐指数
4
解决办法
3万
查看次数

openssl无法生成具有有效别名的pfx

我正在尝试根据这些说明生成一个pfx文件,以用作某些JAR文件的签名机制.

要创建pfx文件,我使用以下命令

openssl pkcs12 -export -in my-cert.crt -inkey my-priv-key.key -certfile my-ca-bundle -out my-pfx.pfx
Run Code Online (Sandbox Code Playgroud)

当我尝试使用以下命令查找别名时,此命令成功生成了一个pfx文件

keytool -list -storetype pkcs12 -keystore my-pfx.pfx -v | grep Alias
Run Code Online (Sandbox Code Playgroud)

我收到以下回复

Alias name: 2
Run Code Online (Sandbox Code Playgroud)

根据上面链接的说明(以及我做过的其他研究),返回的Alias看起来应该是这样的

le-d491f28f-ee7b-40e2-b1a7-2b7c3a71979a
Run Code Online (Sandbox Code Playgroud)

如果我尝试使用Alias值,我将使用以下命令获取(例如2)

jarsigner -keystore my-pfx.pfx -storetype PKCS12 jacob.jar 2
Run Code Online (Sandbox Code Playgroud)

这会导致以下错误消息

jarsigner: Certificate chain not found for: 2.  2 must reference a valid KeyStore key entry containing a private key and corresponding public key certificate chain.
Run Code Online (Sandbox Code Playgroud)

我完全难以理解为什么我没有得到正确的别名..任何有用的建议?

谢谢

openssl certificate keytool pfx jarsigner

14
推荐指数
1
解决办法
2万
查看次数

为keytool命令添加密码

我已经制作了一个.bat文件来获取我的Android应用程序的SHA1,所以我不需要每次都输入命令

keytool -list -v -keystore "Path/To/My/Key.jks"

当我运行bat文件时,我会被要求输入密码.是否可以将密码放在命令中,例如--password MyPassword,或者在.bat文件中等待输入您的密码行,然后发送密码?我对.bat文件没有任何经验,所以我不知道是否可以这样做.

我查看了--help for keytool,我能看到的唯一密码标志是更改密码,而不指定密码.

batch-file keytool

14
推荐指数
2
解决办法
2万
查看次数

将证书导入为PrivateKeyEntry

我在Tomcat服务器上安装SSL,并遵循发行人https://knowledge.rapidssl.com/support/ssl-certificate-support/index?page=content&actp=CROSSLINK&id=SO16181的这些说明,并声明:

Verify the following information:

The SSL certificate is imported into the alias with the "Entry Type" of 
PrivateKeyEntry or KeyEntry.  If not, please import the certificate into 
the Private Key alias.
Run Code Online (Sandbox Code Playgroud)

当我导入证书(tomcat)时我正在使用:

keytool -import -trustcacerts -alias your_alias_name -keystore your_keystore_filename
-file your_certificate_filename
Run Code Online (Sandbox Code Playgroud)

但是当我这样做时它导入为trustCertEntry

Keystore type: JKS
Keystore provider: SUN

Your keystore contains 3 entries

primaryca, Jul 26, 2014, trustedCertEntry,
Certificate fingerprint (SHA1): <snip>
tomcat, Jul 26, 2014, trustedCertEntry,
Certificate fingerprint (SHA1):  <snip>
secondaryca, Jul 26, 2014, trustedCertEntry,
Certificate …
Run Code Online (Sandbox Code Playgroud)

ssl keystore keytool

14
推荐指数
3
解决办法
5万
查看次数

如何使用keytool创建证书链?

我想在java中创建证书链,如下所示:

ca.mycompany.com
|--asia.mycompany.com
   |--india.mycompany.com
Run Code Online (Sandbox Code Playgroud)

其中ca.mycompany.com是根证书(自签名).

我知道这可以通过OpenSSL实现.但是有可能用keytool实现这一目标吗?

如果没有,我可以使用Mozilla NSS库实现这一目标吗?

ssl nss keytool

14
推荐指数
2
解决办法
3万
查看次数

linux中的keytool导入证书java.util.IllegalFormatConversionException

我想创建一个在tomcat中使用的密钥库,但是我使用keytool得到了错误"java.util.IllegalFormatConversionException:d!= java.lang.String".这只发生在linux(centos7)中,而不是在windows中.我创建了密钥库

keytool -genkey -keyalg RSA -alias client -keystore testkeystore -storepass mypassword  -validity 3650
Run Code Online (Sandbox Code Playgroud)

并试图导入证书

keytool -import -alias  arubaauth  -trustcacerts -keystore testkeystore -file root_autenticazione_ATe.cer
Run Code Online (Sandbox Code Playgroud)

相同的命令和相同的证书在Windows中不显示任何错误.

怎么了?

提前致谢

tomcat keystore keytool cer

14
推荐指数
1
解决办法
7826
查看次数

在Spring Boot 2.0中使用自签名证书启用HTTPS

我正在按照本教程使用自签名证书在Spring Boot 2.0中启用HTTPS,仅用于测试目的.总之,该教程包括以下步骤:

1.使用生成密钥库keytool.

keytool -genkey -alias tomcat
 -storetype PKCS12 -keyalg RSA -keysize 2048
 -keystore keystore.p12 -validity 3650
Run Code Online (Sandbox Code Playgroud)

2.通过在application.properties文件中添加一些属性,在Spring Boot中启用HTTPS .

server.port: 8443
server.ssl.key-store: keystore.p12
server.ssl.key-store-password: mypassword
server.ssl.keyStoreType: PKCS12
server.ssl.keyAlias: tomcat
Run Code Online (Sandbox Code Playgroud)

3.将HTTP重定向到HTTPS(可选).我忽略了这部分.

但是当我启动我的应用程序时,我收到了以下错误:

org.apache.catalina.LifecycleException: Failed to start component [Connector[HTTP/1.1-8443]]
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:167) ~[tomcat-embed-core-8.5.28.jar:8.5.28]
    at org.apache.catalina.core.StandardService.addConnector(StandardService.java:225) ~[tomcat-embed-core-8.5.28.jar:8.5.28]
    at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.addPreviouslyRemovedConnectors(TomcatWebServer.java:255) [spring-boot-2.0.0.RELEASE.jar:2.0.0.RELEASE]
    at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.start(TomcatWebServer.java:197) [spring-boot-2.0.0.RELEASE.jar:2.0.0.RELEASE]
    at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.startWebServer(ServletWebServerApplicationContext.java:300) [spring-boot-2.0.0.RELEASE.jar:2.0.0.RELEASE]
    at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.finishRefresh(ServletWebServerApplicationContext.java:162) [spring-boot-2.0.0.RELEASE.jar:2.0.0.RELEASE]
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:552) [spring-context-5.0.4.RELEASE.jar:5.0.4.RELEASE]
    at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:140) [spring-boot-2.0.0.RELEASE.jar:2.0.0.RELEASE]
    at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:752) [spring-boot-2.0.0.RELEASE.jar:2.0.0.RELEASE]
    at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:388) [spring-boot-2.0.0.RELEASE.jar:2.0.0.RELEASE]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:327) [spring-boot-2.0.0.RELEASE.jar:2.0.0.RELEASE]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1246) …
Run Code Online (Sandbox Code Playgroud)

java https keystore keytool spring-boot

14
推荐指数
3
解决办法
2万
查看次数

使用Java生成证书,公钥和私钥

我正在寻找一个java库或代码来动态生成证书,公钥和私钥,而不使用第三方程序(如openssl).

我觉得有些东西是使用keytool + openssl但是来自Java代码.

考虑使用ssl和客户端身份验证保护的基于java servlet的Web应用程序.我希望servlet容器仅在请求时使用Java代码生成客户端证书(例如,pkcs12格式).

java ssl openssl keytool

13
推荐指数
2
解决办法
3万
查看次数

将CA签名的JKS密钥库转换为PEM

我有一个由CA签名的JKS密钥库.我需要以PEM格式导出它以便与nginx一起使用.我需要这样做,它包括整个链,以便我的客户可以验证签名.

如果我这样做:

keytool -exportcert -keystore mykestore.jks -file mycert.crt -alias myalias
openssl x509 -out mycert.crt.pem -outform pem -in mycert.crt -inform der
Run Code Online (Sandbox Code Playgroud)

它只包括最低级别的证书.验证失败:

$ openssl s_client -connect localhost:443
CONNECTED(00000003)
depth=0 /O=*.mydomain.com/OU=Domain Control Validated/CN=*.mydomain.com
verify error:num=20:unable to get local issuer certificate
verify return:1
depth=0 /O=*.mydomain.com/OU=Domain Control Validated/CN=*.mydomain.com
verify error:num=27:certificate not trusted
verify return:1
depth=0 /O=*.mydomain.com/OU=Domain Control Validated/CN=*.mydomain.com
verify error:num=21:unable to verify the first certificate
verify return:1
---
Certificate chain
 0 s:/O=*.mydomain.com/OU=Domain Control Validated/CN=*.mydomain.com
   i:/C=US/ST=Arizona/L=Scottsdale/O=GoDaddy.com, Inc./OU=http://certificates.godaddy.com/repository/CN=Go Daddy Secure Certification Authority/serialNumber=123123
... (only one certificate!) …
Run Code Online (Sandbox Code Playgroud)

openssl keystore jks keytool pem

13
推荐指数
3
解决办法
3万
查看次数