This is a CLI tool that wraps
amazon-s3-encryption-client-java.
With this CLI, you can use your local public/private keys for client-side encryption to put/get objects to/from your Amazon S3 bucket.
- mvn
- Java 8 or later
- RSA Public key and Private Key in PEM format
You can generate an RSA key pair using openssl
with the following commands:
$ openssl genpkey -algorithm RSA -out private_key.pem
$ openssl rsa -pubout -in private_key.pem -out public_key.pem
You can download the JAR file from the Releases section and run it directly. For instructions on how to use the JAR file, please refer to the release notes.
If you have downloaded the source code and want to run,
to print the usage:
$ mvn install
$ mvn exec:java -DskipTests -Dexec.args="-h"
To upload:
$ mvn exec:java -DskipTests \
-Dexec.args="--upload \
--bucket-name your-s3-bucket-name \
--object-key hello.txt \
--local-file-path ./hello.txt \
-p ./public_key.pem -k ./private_key.pem"
Note: Private key is not necessary for upload, and Public key is not necessary for download.
To run tests,
- Duplicate the .env.test.template files.
- Rename the duplicates to .env.test respectively.
- Populate the values.
$ export $(cat .env.test | xargs -L 1) && mvn test
Install the Language Support for Java(TM) by Red Hat extension for VSCode.
Afterwards, open this project as a workspace from the file named amazon-s3-encryption-client-java-example
located in the .vscode
directory.
Once done, your Java code will be automatically formatted upon saving.