Use a remote keystore provider
Hyper-Converged Database (HCD) uses the Java Cryptography API (JCA) to implement SSL providers.
The JCA is a pluggable architecture that abstracts the actual cryptography implementation from the algorithm requested.
To support swapping out different implementations, HCD database uses Cipher.getInstance("AES")
.
Introduction
The JCA architecture Provider class allows multiple implementations to register using a different service provider interface (SPI).
Java comes with multiple providers and supports installation of additional providers, such as PKCS12
.

There are a few important points to consider regarding PKCS12
and PKCS11
support:
The location of the cassandra.yaml
file depends on your installation type.
-
Package installations
-
Tarball installations
/etc/hcd/cassandra/cassandra.yaml
INSTALLATION_LOCATION/resources/cassandra/conf/cassandra.yaml
Replace INSTALLATION_LOCATION with the path where you extracted the HCD tarball.
-
For
PKCS12
, incassandra.yaml
, the relevant property istruststore_type
. HCD uses it to determine the desired SPI. The valid values fortruststore_type
areJKS
,JCEKS
, orPKCS12
. The default isJKS
, and the recommended setting for file-based truststores isPKCS12
. However, there is a caveat and a workaround:
Due to an OpenSSL issue, you cannot use a PKCS12 truststore that was generated via OpenSSL. For example, a truststore generated via the following command will not work with DSE:
openssl pkcs12 -export -nokeys -out truststore.pfx -in <intermediate.chain.pem>
However, truststores generated via Java’s keytool
and then converted to PKCS12 work with DSE.
Example:
keytool -importcert -alias <rootca> -file <rootca.pem> -keystore <truststore.jks>
keytool -importcert -alias <intermediate> -file <intermediate.pem> -keystore <truststore.jks>
keytool -importkeystore -srckeystore <truststore.jks> -destkeystore <truststore.pfx> -deststoretype pkcs12
-
For
PKCS11
, incassandra.yaml
, the relevant property iskeystore_type
. Valid types areJKS
,JCEKS
,PKCS11
,PKCS12
. The default isJKS
, and the recommended setting for file-based keystores isPKCS12
. IfPKCS11
is desired, note the following:DataStax supports PKCS11 as a
keystore_type
on nodes withcassandra
oradvanced
workloads. Theadvanced
workload support was added for DSE 6.8.2 and later. IfPKCS11
is needed, inserver_encryption_options
orclient_encryption_options
, specify thekeystore_type
asPKCS11
and thekeystore
asNONE
.PKCS11
is not supported as atruststore_type.
-
For
cassandra.yaml
reference descriptions, see thetruststore_type
andkeystore_type
settings.
Differences between PKCS11
and PKCS12
PKCS11
and PKCS12
are part of the RSA Public Key Cryptography Standards for storing private key and certificate information.
Review the important caveats listed earlier in this topic, if you have not already done so.
PKCS12
is typically used to store private key and certificate information on files.
The default keystore type in Java is JKS
, though you can specify PKCS12
with the -deststoretype
option when creating a keystore with keytool
.
Be sure to read the notes above that contain information about an openssl
bug, and the workaround via keytool
for PKCS12
support.
PKCS11
provides an interface to connect with hardware keystore devices.
This type of keystore can store private keys, secret keys, and certificates like PKCS12
, but is designed for Hardware Storage Modules (HSM).
Install additional providers
Install providers using the java.security
configuration that comes with the JRE.
For more detailed instructions, see How to implement a Provider (Oracle). |
Add the location to the java.security
configuration file, which is located in $<JAVA_HOME>/lib/security/java.security
.
For an environment where PKCS11
is the keystore type and a Cassandra-only workload, use:
security.provider.10=sun.security.pkcs11.SunPKCS11 <path-to-pkcs11-provider-config-file>
Example:
security.provider.10=sun.security.pkcs11.SunPKCS11 /opt/bar/cfg/pkcs11.cfg
For details, see the Oracle JDK 11 PKCS#11 Reference Guide.