Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
53a2865
chore: s3ec v3 transtion and v4 improved tests
imabhichow Oct 17, 2025
1e5b2ea
comment cpp checkout
imabhichow Oct 27, 2025
e0e7ab3
bump s3ec-java commits
imabhichow Oct 27, 2025
5dbb019
chore: add duvet reports for s3ec-java (transition & improved)
imabhichow Sep 30, 2025
ddfdb9b
format
imabhichow Oct 27, 2025
009d1b2
git-ignore
imabhichow Oct 27, 2025
e12fa7d
Merge branch 'fireegg-test-servers' into imabhichow/java-v4-extended-…
imabhichow Oct 27, 2025
db6c65d
Merge branch 'fireegg-test-servers' into imabhichow/java-v4-extended-…
imabhichow Oct 29, 2025
a570537
update java submodule
imabhichow Oct 27, 2025
39fc548
fix configuration
imabhichow Oct 29, 2025
c755778
Revert "chore: reenable c++ (#52)"
imabhichow Oct 29, 2025
d72d851
remove java transiton for now
imabhichow Oct 30, 2025
0dc303f
fix configuration
imabhichow Oct 30, 2025
88c2bc5
fix configuration
imabhichow Oct 30, 2025
edd534e
Update test configuration
imabhichow Oct 30, 2025
12614dc
Duvet
imabhichow Nov 5, 2025
76387f0
Merge remote-tracking branch 'origin/fireegg-test-servers' into imabh…
imabhichow Nov 5, 2025
d0457ad
Rebase
imabhichow Nov 5, 2025
ec3dabf
Merge branch 'fireegg-test-servers' into imabhichow/java-v4-extended-…
imabhichow Nov 6, 2025
131d905
nit - format
imabhichow Nov 6, 2025
ebdaa64
Merge remote-tracking branch 'origin/fireegg-test-servers' into imabh…
imabhichow Nov 7, 2025
9acf8ad
Change java-v4-port
imabhichow Nov 7, 2025
398fc4e
duvet changes
imabhichow Nov 7, 2025
cd342a1
Dotnet change
imabhichow Nov 7, 2025
a8a025b
Merge branch 'fireegg-test-servers' into imabhichow/java-v4-extended-…
imabhichow Nov 7, 2025
2b1b810
remove symlink
imabhichow Nov 7, 2025
e0ee483
Fix Tests
imabhichow Nov 7, 2025
87b3bb1
chore: enable java-v3-transition test server
imabhichow Nov 10, 2025
4ccaab4
chore: enable java-v3-transition test server
imabhichow Nov 10, 2025
ff8e92b
update .gitmodule branch
imabhichow Nov 10, 2025
2d477a6
Merge remote-tracking branch 'origin/fireegg-test-servers' into imabh…
imabhichow Nov 10, 2025
3769f83
Merge branch 'fireegg-test-servers' into imabhichow/java-test-server-v3
imabhichow Nov 10, 2025
d290f89
Merge remote-tracking branch 'origin/fireegg-test-servers' into imabh…
imabhichow Nov 12, 2025
f85bf2e
Merge branch 'fireegg-test-servers' into imabhichow/java-test-server-v3
imabhichow Nov 13, 2025
09d339d
Merge Conflicts
imabhichow Nov 13, 2025
4c820d9
Merge branch 'fireegg-test-servers' into imabhichow/java-test-server-v3
imabhichow Nov 13, 2025
d5d35ee
chore: java examples
imabhichow Nov 13, 2025
28afa93
chore: java examples
imabhichow Nov 13, 2025
2c80cd5
Merge branch 'fireegg-test-servers' into imabhichow/java-test-server-v3
imabhichow Nov 13, 2025
e5ba4f6
chore: update client configuration to allow for default.
imabhichow Nov 13, 2025
3a117c6
point iv's changes commit
imabhichow Nov 13, 2025
97b95eb
Merge branch 'fireegg-test-servers' into imabhichow/java-test-server-v3
imabhichow Nov 13, 2025
b99808b
Apply suggestion from @rishav-karanjit
imabhichow Nov 13, 2025
88a57ee
allow java
imabhichow Nov 13, 2025
e5313cf
fix duvet
imabhichow Nov 13, 2025
c672dcf
Merge branch 'fireegg-test-servers' into imabhichow/java-test-server-v3
imabhichow Nov 13, 2025
f33dcab
Merge remote-tracking branch 'origin/imabhichow/java-test-server-v3' …
imabhichow Nov 13, 2025
0d06689
examples
imabhichow Nov 13, 2025
e97d569
Merge branch 'fireegg-test-servers' into imabhichow/examples
imabhichow Nov 14, 2025
5297e73
examples - remove gitignore
imabhichow Nov 14, 2025
6242b67
Merge branch 'fireegg-test-servers' into imabhichow/examples
imabhichow Nov 14, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
75 changes: 75 additions & 0 deletions all-examples/java/v3/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# Makefile for S3 Encryption Client Java v3 Example

# Default target
.PHONY: all install clean run help s3ec-staging

# Default arguments for running the example
# Override these when calling make run
BUCKET_NAME ?= avp-21638
OBJECT_KEY ?= s3ec-java-v3
KMS_KEY_ID ?= arn:aws:kms:us-east-2:648638458147:key/a47079da-17e4-45a5-b82e-2bac101cad01
AWS_REGION ?= us-east-2

all: install

# Install S3 Encryption Client library from source
s3ec-staging:
@echo "[JAVA V3] Installing S3 Encryption Client library from source..."
@cd s3ec-staging && mvn -B -ntp install -DskipTests
@echo "[JAVA V3] S3 Encryption Client library installed successfully!"

# Install dependencies using Gradle
install: s3ec-staging
@echo "[JAVA V3] Installing Java dependencies..."
@chmod +x ./gradlew
@./gradlew build
@echo "[JAVA V3] Dependencies installed successfully!"

# Clean Gradle artifacts
clean:
@echo "[JAVA V3] Cleaning Gradle artifacts..."
@./gradlew clean
@echo "[JAVA V3] Clean completed!"

# Run the example with default arguments
run: install
@echo "[JAVA V3] Running S3 Encryption Client v3 Java example..."
@echo "[JAVA V3] Bucket: $(BUCKET_NAME)"
@echo "[JAVA V3] Object Key: $(OBJECT_KEY)"
@echo "[JAVA V3] KMS Key ID: $(KMS_KEY_ID)"
@echo "[JAVA V3] Region: $(AWS_REGION)"
@echo ""
@./gradlew run --args="$(BUCKET_NAME) $(OBJECT_KEY) $(KMS_KEY_ID) $(AWS_REGION)"

# Run with custom arguments
# Usage: make run-custom BUCKET_NAME=my-bucket OBJECT_KEY=my-key KMS_KEY_ID=my-kms-key AWS_REGION=my-region
run-custom: install
@./gradlew run --args="$(BUCKET_NAME) $(OBJECT_KEY) $(KMS_KEY_ID) $(AWS_REGION)"

# Show help
help:
@echo "S3 Encryption Client Java v3 Example Makefile"
@echo ""
@echo "Available targets:"
@echo " s3ec-staging - Install S3 Encryption Client library from source"
@echo " install - Install Java dependencies using Gradle"
@echo " run - Install dependencies and run the example with default parameters"
@echo " run-custom - Install dependencies and run with custom parameters"
@echo " clean - Remove Gradle artifacts"
@echo " help - Show this help message"
@echo ""
@echo "Default parameters:"
@echo " BUCKET_NAME = $(BUCKET_NAME)"
@echo " OBJECT_KEY = $(OBJECT_KEY)"
@echo " KMS_KEY_ID = $(KMS_KEY_ID)"
@echo " AWS_REGION = $(AWS_REGION)"
@echo ""
@echo "To run with custom parameters:"
@echo " make run BUCKET_NAME=your-bucket OBJECT_KEY=your-key KMS_KEY_ID=your-kms-key AWS_REGION=your-region"
@echo ""
@echo "Prerequisites:"
@echo " - Java 11+ installed on the system"
@echo " - AWS credentials configured (AWS CLI, environment variables, or IAM role)"
@echo " - Valid S3 bucket and KMS key with appropriate permissions"
@echo " - S3 Encryption Client v3 library installed in local Maven repository"
@echo " (Install by running: cd s3ec-staging && mvn install)"
57 changes: 57 additions & 0 deletions all-examples/java/v3/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# S3 Encryption Client Java v3 Example

This example demonstrates how to use the Amazon S3 Encryption Client v3 for Java to perform client-side encryption and decryption of objects.

## Prerequisites

1. **Java**: Requires Java 11 or later
2. **Gradle**: The project uses Gradle wrapper (included - `./gradlew`)
3. **Maven**: Required to install the S3 Encryption Client library from source
4. **AWS Credentials**: Configure your AWS credentials using one of the following methods:
- AWS CLI: `aws configure`
- Environment variables: `AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY`
- IAM roles (for EC2 instances)
5. **KMS Key**: You'll need a KMS key ID or ARN. You can use the default example key: `arn:aws:kms:us-east-2:648638458147:key/a47079da-17e4-45a5-b82e-2bac101cad01`
6. **S3 Bucket**: An existing S3 bucket where you have read/write permissions

## Setup

Install dependencies and build (this automatically installs the S3 Encryption Client library from source):
```bash
make install
```

Or manually:
```bash
cd s3ec-staging && mvn clean install && cd -
./gradlew build
```

**Note**: This example uses a local library installed in Maven local repository via the symbolic link `s3ec-staging`.

## Usage

### Using Make (Recommended)

Run the example with default parameters:
```bash
make run
```

Run with custom parameters:
```bash
make run BUCKET_NAME=my-bucket OBJECT_KEY=my-key KMS_KEY_ID=my-kms-key AWS_REGION=my-region
```

### Manual Usage

Run the example with the following command:

```bash
./gradlew run --args="<bucket-name> <object-key> <kms-key-id> <region>"
```

### Example:

```bash
./gradlew run --args="my-test-bucket s3ec-java-v3-test arn:aws:kms:us-east-2:648638458147:key/a47079da-17e4-45a5-b82e-2bac101cad01 us-east-2"
47 changes: 47 additions & 0 deletions all-examples/java/v3/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
plugins {
java
application
}

group = "software.amazon.encryption.s3.example"
version = "1.0.0"

repositories {
mavenLocal()
mavenCentral()
}

dependencies {
// AWS SDK v2 dependencies
implementation(platform("software.amazon.awssdk:bom:2.20.0"))
implementation("software.amazon.awssdk:s3")
implementation("software.amazon.awssdk:kms")
implementation("software.amazon.awssdk:auth")

// S3 Encryption Client v3 from local Maven repository
implementation("software.amazon.encryption.s3:amazon-s3-encryption-client-java:3.4.0-read-kc")
}

application {
mainClass.set("software.amazon.encryption.s3.example.Main")
}

java {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}

tasks.jar {
manifest {
attributes["Main-Class"] = "software.amazon.encryption.s3.example.Main"
}

// Create a fat jar with all dependencies
from(configurations.runtimeClasspath.get().map { if (it.isDirectory) it else zipTree(it) })
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
archiveBaseName.set("s3ec-java-v3-example")
}

tasks.named<JavaExec>("run") {
standardInput = System.`in`
}
Binary file not shown.
7 changes: 7 additions & 0 deletions all-examples/java/v3/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading
Loading