@@ -41,8 +41,7 @@ Import the following classes for these examples.
4141
4242**Imports **
4343
44- .. literalinclude :: example_code/s3/src/main/java/aws/example/s3/S3Encrypt.java
45- :lines: 16-31
44+ .. literalinclude :: s3.java1.s3_encrypt.import.txt
4645 :language: java
4746
4847.. _encryption-only-kms :
@@ -57,8 +56,7 @@ managed key for encryption, pass the |KMS| key ID or alias to the
5756
5857**Code **
5958
60- .. literalinclude :: example_code/s3/src/main/java/aws/example/s3/S3Encrypt.java
61- :lines: 237-243
59+ .. literalinclude :: s3.java1.s3_encrypt.kms_encryption_only_build.txt
6260 :dedent: 8
6361 :language: java
6462
@@ -67,8 +65,7 @@ Call the :methodname:`putObject` method on the |S3| encryption client to upload
6765
6866**Code **
6967
70- .. literalinclude :: example_code/s3/src/main/java/aws/example/s3/S3Encrypt.java
71- :lines: 247
68+ .. literalinclude :: s3.java1.s3_encrypt.kms_encryption_only_put_object.txt
7269 :dedent: 8
7370 :language: java
7471
@@ -77,12 +74,11 @@ You can retrieve the object using the same client. This example calls the
7774
7875**Code **
7976
80- .. literalinclude :: example_code/s3/src/main/java/aws/example/s3/S3Encrypt.java
81- :lines: 249
77+ .. literalinclude :: s3.java1.s3_encrypt.kms_encryption_only_retrieve.txt
8278 :dedent: 8
8379 :language: java
8480
85- See the :sdk-examples-java-s3: `complete example <S3Encrypt.java#L236-L250 > ` on GitHub.
81+ See the :sdk-examples-java-s3: `complete example <S3Encrypt.java> ` on GitHub.
8682
8783.. _authenticated-encryption-kms :
8884
@@ -106,23 +102,21 @@ To enable this mode, specify the :classname:`AuthenticatedEncryption` value in t
106102
107103**Code **
108104
109- .. literalinclude :: example_code/s3/src/main/java/aws/example/s3/S3Encrypt.java
110- :lines: 257-263
105+ .. literalinclude :: s3.java1.s3_encrypt.kms_authenticated_encryption_builder.txt
111106 :dedent: 8
112107 :language: java
113-
108+
114109The :classname: `AuthenticatedEncryption ` mode can retrieve unencrypted objects and
115110objects encrypted with :classname: `EncryptionOnly ` mode. The following example shows the
116111|S3 | encryption client retrieving an unencrypted object.
117112
118113**Code **
119114
120- .. literalinclude :: example_code/s3/src/main/java/aws/example/s3/S3Encrypt.java
121- :lines: 257-270
115+ .. literalinclude :: s3.java1.s3_encrypt.kms_authenticated_encryption_put_object.txt
122116 :dedent: 8
123117 :language: java
124118
125- See the :sdk-examples-java-s3: `complete example <S3Encrypt.java#L256-L271 > ` on GitHub.
119+ See the :sdk-examples-java-s3: `complete example <S3Encrypt.java> ` on GitHub.
126120
127121.. _strict-authenticated-encryption-kms :
128122
@@ -138,8 +132,15 @@ To enable this mode, specify the :classname:`StrictAuthenticatedEncryption` valu
138132
139133**Code **
140134
141- .. literalinclude :: example_code/s3/src/main/java/aws/example/s3/S3Encrypt.java
142- :lines: 278-284
135+ .. literalinclude :: s3.java1.s3_encrypt.kms_authenticated_encryption_strict_builder.txt
136+ :dedent: 8
137+ :language: java
138+
139+ Call the :methodname: `putObject ` method on the |S3 | encryption client to upload objects.
140+
141+ **Code **
142+
143+ .. literalinclude :: s3.java1.s3_encrypt.kms_authenticated_encryption_strict_put_object.txt
143144 :dedent: 8
144145 :language: java
145146
@@ -149,9 +150,8 @@ authenticated mode.
149150
150151**Code **
151152
152- .. literalinclude :: example_code/s3/src/main/java/aws/example/s3/S3Encrypt.java
153- :lines: 278-295
153+ .. literalinclude :: s3.java1.s3_encrypt.kms_authenticated_encryption_strict_exception.txt
154154 :dedent: 8
155155 :language: java
156156
157- See the :sdk-examples-java-s3: `complete example <S3Encrypt.java#L278-L296 > ` on GitHub.
157+ See the :sdk-examples-java-s3: `complete example <S3Encrypt.java> ` on GitHub.
0 commit comments