Skip to content

Commit 8e438d3

Browse files
author
Anirav Kareddy
committed
Added S3Keyring class
1 parent 13d4ee7 commit 8e438d3

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/main/java/software/amazon/encryption/s3/materials/S3Keyring.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,13 @@ abstract public class S3Keyring implements Keyring {
2626
protected final DataKeyGenerator _dataKeyGenerator;
2727
private final boolean _enableLegacyWrappingAlgorithms;
2828
private final SecureRandom _secureRandom;
29+
protected final MaterialsDescription _materialsDescription;
2930

3031
protected S3Keyring(Builder<?, ?> builder) {
3132
_enableLegacyWrappingAlgorithms = builder._enableLegacyWrappingAlgorithms;
3233
_secureRandom = builder._secureRandom;
3334
_dataKeyGenerator = builder._dataKeyGenerator;
35+
_materialsDescription = builder._materialsDescription;
3436
}
3537

3638
/**
@@ -149,6 +151,7 @@ abstract public static class Builder<KeyringT extends S3Keyring, BuilderT extend
149151
private boolean _enableLegacyWrappingAlgorithms = false;
150152
private SecureRandom _secureRandom;
151153
private DataKeyGenerator _dataKeyGenerator = new DefaultDataKeyGenerator();
154+
protected MaterialsDescription _materialsDescription;
152155

153156

154157
protected Builder() {}
@@ -180,6 +183,10 @@ public BuilderT dataKeyGenerator(final DataKeyGenerator dataKeyGenerator) {
180183
_dataKeyGenerator = dataKeyGenerator;
181184
return builder();
182185
}
186+
public BuilderT materialsDescription(final MaterialsDescription materialsDescription) {
187+
_materialsDescription = materialsDescription;
188+
return builder();
189+
}
183190

184191
abstract public KeyringT build();
185192
}

0 commit comments

Comments
 (0)