Quantcast
Channel: Active questions tagged https - Stack Overflow
Viewing all articles
Browse latest Browse all 1534

How do I correctly store the certificate chain (rootCA -> server csr) into a keystore in Scala, with self-signed certificates?

$
0
0

I have a single rootCA certificate in the resource folder (along with its private key) of my project.

When the software starts, it initialises the SSLManager object, which in turn:

  • Loads the rootCA into an x509Certificate
  • Loads the rootCA private key
  • Generates a server keypair and certificate
  • Signs the certificate using the rootCA

I would like to store the rootCA and server certificate into a keystore, that I can later use to setup an SSLContext, and for more secure storage.

I know how to store a single keypair/certificate into a keystore, but how would I correctly go about this for a chain?

I presume:

keyStore.setKeyEntry(ALIAS, privateKey, password.toCharArray, Array(rootCA, serverCert))

However, if true, which private key do I use (rootCA vs server)?

A full example would be much appreciated.


Viewing all articles
Browse latest Browse all 1534

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>