Code samples for the AWS CloudHSM software library for Java
Prerequisites
Before running the samples, you must set up your environment:
-
Install and configure the Java Cryptographic Extension (JCE) provider.
-
Set up a valid HSM user name and password. Cryptographic user (CU) permissions are sufficient for these tasks. Your application uses these credentials to log in to the HSM in each example.
-
Decide how to provide credentials to the JCE provider.
Code samples
The following code samples show you how to use the AWS CloudHSM
JCE provider to perform basic tasks. More code samples are available on GitHub
-
Encrypt and decrypt with DESede-ECB
see note 1
[1] Disallowed after 2023 for FIPS compliance as per NIST guidance. See FIPS 140 Compliance: 2024 Mechanism Deprecation for details.