Questions tagged [jks]

A Java KeyStore (JKS) is a repository of cryptographic keys and certificates - used for instance in TLS encryption. It is defined within the Java Cryptography Architecture specification.

The file extension jks commonly refers to a Java keystore as defined in the Java Cryptography Architecture (JCA) specification. This file structure is used to hold bare keys, personal certificates and public certificates for use by Java-based applications.

The Java JDK references two different jks files. One, called the Trust Store holds the trusted certificates, such as the signer certificates issued by a Certificate Authority, or the personal certificates issued by peer nodes. Because all the certificates in the trust store are the public portion of the certificate pairs they represent, the security requirements for this file are significantly lower than those for private certificates and keys. The primary risk is to ensure secure provisioning to prevent insertion of undesired certificates. However, there is little to no risk in the file being world readable.

Separating the keystore and trust store files allows for the trust store to be distributed as part of an application's configuration package. The default location for this file is [jre home]/lib/security/cacerts.

Note that although this file is called a trust store to distinguish it from the keystore that holds the private keys, it uses the jks format and file name extension.

The second file referenced by the JDK is the keystore that contains the application's personal certificate and private keys, if any. Because these elements are private, they are usually generated in place in the local filesystem or hardware security module, and then never moved.

Managing the private keys and personal certificates centrally and then deploying them creates an additional security risk. If the central repository is breached, all certificates are compromised at once. When the certificates are transported improperly, it is possible to leave images of them in temp files, memory, cache and the local filesystems. For these reasons central management of private crypto elements is best performed by a purpose built Public Key Infrastructure (PKI) management system. A well-built PKI uses many additional controls to mitigate risks of breach and of leakage in transit.

JDKs provide a utility named keytool to manipulate the keystore and the cryptographic assets that it contains. The keytool utility includes functions to generate keys, generate certificate signing requests, import and export keys and certificates, and delete keys and certificates from the keystore.

497 questions
0
votes
1 answer

How to specify remote JKS keystore with Tomcat?

In Tomcat you configure your server.xml with the following SSL Connector:
smeeb
  • 27,777
  • 57
  • 250
  • 447
0
votes
0 answers

SSL/TLS - PEM to JKS

I generated my private key with openssl and it is file serverkey.pem, I have also serverreq.pem that I sent to cert authority. They will send me signed certificate. Is there any way how to convert serverkey.pem into Java Key Store? Do I have to…
hiimjames
  • 431
  • 4
  • 10
0
votes
1 answer

Signing messages using Apache CXF's JAX-RS implementation

I have a .jks file and I need to sign a message using JAX-RS. I was using apache-cxf's rest implementation. I have gone through the apache cxf site for signing messages using jax-rs, but I didn't get clear idea on that. Coding: String keystr =…
LazyGuy
  • 715
  • 4
  • 12
  • 27
0
votes
1 answer

What is the difference between the .Kdb file, the .jks file, and the CMS file?

When I connect to the Remote Queue Manager, which is configured with SSL, using C# code What is the difference between the .Kdb file, the .jks file, and the CMS file? Do I need to point the .kdb file (or) the .jks file to the…
user4276883
  • 55
  • 2
  • 5
0
votes
2 answers

Convert public cert, private key, and certificate chain .pem files to jks keystore

I have 3 separate .pem files: publicCert.pem privateKey.pem CertificateChain.pem I want to put these into a new java keystore. I have seen this question asked and answered before, but with only 1 or 2 .pem files, not 3, and not specifically for a…
Jim P.
  • 1,087
  • 3
  • 9
  • 24
0
votes
1 answer

Moving a Java Keystore

I have a wildcard cert and a jks with my chain of trust. When I want to use the wild card on another host for SSL (another java web server), do I simply copy the jks to the other host and use? Or is the jks specific to a host and therefore should…
Bean
  • 550
  • 2
  • 8
  • 21
0
votes
2 answers

TrustStore and Keystore during 2 way SSL validation

I have been unable to find a solution to this problem elsewhere so I am hoping someone here can provide some insight. My setup below: keystore, myKeys.jks: mine-private, 3/6/2014, PrivateKeyEntry mine-trusted, 3/6/2014, trustedCertEntry trust…
Woot4Moo
  • 23,987
  • 16
  • 94
  • 151
0
votes
1 answer

issue while migrating application from ibm jdk 6 to oracle jdk7

I am migrating my application from ibm jdk 1.6+geronimo server to oracle jdk1.7+jboss. I have a working version of jks configuration in previous version which is not working in new configuration. I am loading jks file like: …
0
votes
1 answer

Updating certificates in tomcat

I'm using https with Tomcat 6.x. It currently appears to be working as intended. However, a certificate used in the auth chain is about to expire. I am under the assumption that I need to update my keystore so that my host's certificate will…
zmf
  • 9,095
  • 2
  • 26
  • 28
0
votes
1 answer

weblogic ssl cacerts issue

We have a requirement where we have my.crt file which we want to use it with cacerts. I have checked the blogs and documentation its not clear on how to use my.crt file with cacerts I have used…
user414977
  • 265
  • 3
  • 8
  • 24
0
votes
1 answer

Sign XML document with .jks compatiblae key store

I am signing saml Response and assertion with x509 certificate. The response is posted to a java app, which throws error Signature length not correct…". I am asked to make sure that the xml doc is signed with certificate in JKS format and not…
user1181429
  • 31
  • 1
  • 4
0
votes
1 answer

HTTPS (SSL) Request Reading Cert From Keystore Without a Library

I'm looking for some sample code that would read from the JKS and issue an HTTPS request with SSL and it doesn't use a third party library. I've only seen samples using libraries such as Axis.j
user994165
  • 9,146
  • 30
  • 98
  • 165
0
votes
1 answer

SSL Cert Vendor Change

I am trying to prepare for the switch in the SSL certificate vendors. For the the SSL validation, Our Tomcat web application uses a JKS file created from a DigiCert certificate ( *.cer files). Our company is now switching to VeriSign next week.…
Kevin Parker
  • 55
  • 1
  • 3
0
votes
1 answer

How-to generate a JKS keystore Report?

I have been looking for generating a report from a keystore of type JKS. I am looking to see the following details in the report: Alias Name Issued To Validity From Validity To I know, this is possible using Keystore manager tool but manually.…
Srii
  • 543
  • 3
  • 7
  • 20
0
votes
1 answer

Java SSL Connect gets 403 while curl -E succeeds

This question is similar to How to use PEM file to create a SSL socket in Java? however I cannot seem to get the suggested solutions working from that question. I used to be able to connect to a .Net Web Service but now they have implemented SLL…
bmooney
  • 391
  • 6
  • 15