Select your cookie preferences

We use essential cookies and similar tools that are necessary to provide our site and services. We use performance cookies to collect anonymous statistics, so we can understand how customers use our site and make improvements. Essential cookies cannot be deactivated, but you can choose “Customize” or “Decline” to decline performance cookies.

If you agree, AWS and approved third parties will also use cookies to provide useful site features, remember your preferences, and display relevant content, including relevant advertising. To accept or decline all non-essential cookies, choose “Accept” or “Decline.” To make more detailed choices, choose “Customize.”

Allow the JCE provider to extract private key secrets out of AWS CloudHSM

Focus mode
Allow the JCE provider to extract private key secrets out of AWS CloudHSM - AWS CloudHSM

Use the following steps to allow AWS CloudHSM JCE provider to extract your private key secrets.

Important

This configuration change allows extraction of all EXTRACTABLE key bytes in clear from your HSM cluster. For better security, you should consider using key wrapping methods to extract the key out of the HSM securely. This prevents unintentional extraction of your key bytes from the HSM.

  1. Use the following commands to enable your private or secret keys to be extracted in JCE:

    Linux
    $ /opt/cloudhsm/bin/configure-jce --enable-clear-key-extraction-in-software
    Windows
    C:\Program Files\Amazon\CloudHSM\> .\configure-jce.exe --enable-clear-key-extraction-in-software
    $ /opt/cloudhsm/bin/configure-jce --enable-clear-key-extraction-in-software
  2. Once you enable your clear key extraction, the following methods are enabled for extracting private keys into memory.

    Class Method Format (getEncoded)
    Key getEncoded() RAW
    ECPrivateKey getEncoded() PKCS#8
    getS() N/A
    RSAPrivateCrtKey getEncoded() X.509
    getPrivateExponent() N/A
    getPrimeP() N/A
    getPrimeQ() N/A
    getPrimeExponentP() N/A
    getPrimeExponentQ() N/A
    getCrtCoefficient() N/A

If you want restore the default behavior and not allow JCE to export keys in clear, run the following command:

Linux
$ /opt/cloudhsm/bin/configure-jce --disable-clear-key-extraction-in-software
Windows
C:\Program Files\Amazon\CloudHSM\> .\configure-jce.exe --disable-clear-key-extraction-in-software
$ /opt/cloudhsm/bin/configure-jce --disable-clear-key-extraction-in-software
PrivacySite termsCookie preferences
© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved.