keytool

Import PKCS7 (Chained Certificate) using KeyTool command to JKS

青春壹個敷衍的年華 提交于 2019-12-05 03:27:49
I have a CA issued CERT in PKCS#7 format. It has certificates (chained) within it. Keytool does not recognize the PKCS7 format. I have tried OpenSSL tool to convert PKCS7 format certificate to PEM format and it fails. I receive an error message "Unable to load PKCS7 object". How do I import the PKCS7 cert chain to my JKS? As you can read in the keytool reference for -importcert command: Reads the certificate or certificate chain (where the latter is supplied in a PKCS#7 formatted reply) from the file cert_file, and stores it in the keystore entry identified by alias. If no file is given, the

How to convert trust certificate from .jks to .pem?

。_饼干妹妹 提交于 2019-12-05 03:19:11
I have a Java SSL server to which I want my Java SSL client and C++ SSL client to be able to connect. The Java client connects without issues. Now I want to have my C++ SSL client to be able to connect. So for this purpose ,I imagined, that I want to export the serverpub.jks to an .pem file so that my C++ client can load it into its ssl context. But this is not working. Below is a description of how I created the jks keystores for Java client and server and then how I am trying to export the serverpub.jks to .pem file. step 1: Generate the Client and Server Keystores c:\keytool -genkeypair

Java 7 keytool Elliptic Curve Encryption

本秂侑毒 提交于 2019-12-05 02:06:54
I'm trying to create a keystore using keytool with a keyalg ECC. This should be possible according to Oracle . I quote: Area: Tools Synopsis: The keytool and jarsigner tools now support the ECC algorithm in keypair generation and jar signing. RFE: 6870812 I'm using the 32-bit version 1.7.0_07, and I've tried keytool with -keyalg ECC, ECIES, ECDSA,... but I always get Cannot derive signature algorithm . Am I using the wrong Java version? Am I using the wrong name for ECC? Here is the source for the algorithm selection. The allowed values are DSA , RSA and EC . These values are not documented

Difference between Entry Type “keyEntry” and “trustedCertEntry” in a keystore

自闭症网瘾萝莉.ら 提交于 2019-12-05 01:36:43
I don't have much knowledge in this area, but i have still tried to do things by googling. Here is the problem i am facing. Case 1(Works): I have a CA signed certificate and i would like to use it in my Web Application. I first created a keystore. I see that it creates an entry type "keyEntry" in the keystore. Then i import the CA signed certificate to the keystore created. Here are the steps: keytool -genkeypair -keystore keystore.jks I see an entry in the keystore of type "keyEntry" of alias "mykey" Now i import the certificate: keytool -importcert -alias abc -file cert.crt -keystore

jarsigner -verify works in Java 6 but not Java 7

ⅰ亾dé卋堺 提交于 2019-12-05 00:30:14
问题 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:

Keytool set hostname

China☆狼群 提交于 2019-12-04 22:25:09
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 Locality? [Unknown]: hostname What is the name of your State or Province? [Unknown]: hostname What is the

【Tomcat系列】Tomcat SSL配置及Tomcat CA证书安装

烈酒焚心 提交于 2019-12-04 22:25:06
Tomcat既可以作为独立的Servlet容器,也可以作为其他HTTP服务器附加的Servlet容器。如果Tomcat在非独立模式下工作,通常不必配置SSL,由它从属的HTTP服务器来实现和客户的SSL通信。Tomcat和HTTP服务器之间的通信无须采用加密机制,HTTP服务器将解密后的数据传给Tomcat,并把Tomcat发来的数据加密后传给客户。 如果Tomcat作为独立的Java Web服务器,则可以根据安全需要,为Tomcat配置SSL,它包含以下两个步骤: (1) 准备安全证书。 (2) 配置Tomcat的SSL连接器(Connector)。 一、准备安全证书 我在前面的 《SSL简介》 一文中讲过,获得安全证书有两种方式:一种方式是到权威机构购买,还有一种方式是创建自我签名的证书。这里就介绍第二种获取证书的方式,毕竟免费的嘛! SUN公司提供了制作证书的工具keytool。在JDK 1.4以后的版本中都包含了这一工具,它的位置为<JAVA_HOME>\bin\keytool.exe。此外,也可以到SUN的网站上下载,下载地址如下: http://java.sun.com/j2se/1.5.0/docs/tooldocs/#security 通过keytool工具创建证书的命令为: keytool -genkeypair -alias "tomcat" -keyalg

Check android keystore keypass for correctness

不问归期 提交于 2019-12-04 22:14:38
I'm automating some things that involve the android keytool and jarsigner. The tool takes a keystore, the password for the keystore, the alias name, and the password for the alias / key, and I'm trying to find a way to explicitly check to see if the supplied password for the alias / key is correct. Any ideas? Also, I need to check it without a jar file to sign - getting that file in my context is lengthy, so I want to abort sooner rather than later. You can also check if the password is correct without attempting to change the password. I did it by listing the properties of the keystore with

java.io.IOException: Invalid keystore format using Tomcat server

偶尔善良 提交于 2019-12-04 21:59:38
On enabling ssl mode in Tomcat 7, I'm getting the following error on my tomcat logs I have genrated .key file using openssl like below openssl genrsa -des3 -out localhost 2048 And I given the path to my key file in tomcat server.xml SEVERE: Failed to initialize end point associated with ProtocolHandler ["http-bio-8443"] java.io.IOException: Invalid keystore format openssl genrsa -des3 -out localhost 2048 generates a private key. What you need to run a web server using HTTPS is a private key and a certificate. You'll need a step to generate a certificate. You can configure HTTPS in Tomcat using

SSL handshake failure when importing certificates from file

淺唱寂寞╮ 提交于 2019-12-04 21:52:43
I am creating a HTTPS Server and validating the certificates on my own. I have a strange error. When I generate a certificate and add that keystore, I was able to SSL handshake. keytool -genkey -keyalg rsa -alias mycert -keystore lig.keystore -storepass changeit -keypass changeit Whereas When I import the certificate using keytool and add it to the keystore, I am getting SSH Handshake Failure Error. keytool -noprompt -importcert -file certDer -alias mycert -keystore lig.keystore -storepass changeit -keypass changeit To be precise the first one is a self-signed certificate. The second one is a