Class MultipartUploadMaterials
- java.lang.Object
-
- software.amazon.encryption.s3.internal.MultipartUploadMaterials
-
- All Implemented Interfaces:
CryptographicMaterials
public class MultipartUploadMaterials extends Object implements CryptographicMaterials
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classMultipartUploadMaterials.Builder
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description AlgorithmSuitealgorithmSuite()protected voidbeginPartUpload(int nextPartNumber, long partContentLength)Can be used to check the next part number must either be the same (if it was a retry) or increment by exactly 1 during a serial part uploads.static MultipartUploadMaterials.Builderbuilder()CipherModecipherMode()ProvidercryptoProvider()SecretKeydataKey()Map<String,String>encryptionContext()Note that the underlying implementation uses a Collections.unmodifiableMap which is immutable.protected voidendPartUpload()Used to mark the completion of a part upload before the next.CiphergetCipher(byte[] iv)When calling with an IV, sanity check that the given IV matches the one in the cipher.byte[]getIv()booleanhasFinalPartBeenSeen()software.amazon.awssdk.services.s3.model.S3Requests3Request()voidsetHasFinalPartBeenSeen(boolean hasFinalPartBeenSeen)
-
-
-
Method Detail
-
builder
public static MultipartUploadMaterials.Builder builder()
-
hasFinalPartBeenSeen
public final boolean hasFinalPartBeenSeen()
-
setHasFinalPartBeenSeen
public final void setHasFinalPartBeenSeen(boolean hasFinalPartBeenSeen)
-
getCipher
public Cipher getCipher(byte[] iv)
When calling with an IV, sanity check that the given IV matches the one in the cipher. Then just return the cipher.- Specified by:
getCipherin interfaceCryptographicMaterials
-
getIv
public byte[] getIv()
-
beginPartUpload
protected void beginPartUpload(int nextPartNumber, long partContentLength)Can be used to check the next part number must either be the same (if it was a retry) or increment by exactly 1 during a serial part uploads.As a side effect, the
partUploadInProgresswill be set to true upon successful completion of this method. Caller of this method is responsible to callendPartUpload()in a finally block once the respective part-upload is completed (either normally or abruptly).- Throws:
S3EncryptionClientException- if parallel part upload is detected- See Also:
endPartUpload()
-
endPartUpload
protected void endPartUpload()
Used to mark the completion of a part upload before the next. Should be invoked in finally block, and must be preceded previously by a call tobeginPartUpload(int, long).- See Also:
beginPartUpload(int, long)
-
algorithmSuite
public AlgorithmSuite algorithmSuite()
- Specified by:
algorithmSuitein interfaceCryptographicMaterials
-
s3Request
public software.amazon.awssdk.services.s3.model.S3Request s3Request()
- Specified by:
s3Requestin interfaceCryptographicMaterials
-
encryptionContext
public Map<String,String> encryptionContext()
Note that the underlying implementation uses a Collections.unmodifiableMap which is immutable.- Specified by:
encryptionContextin interfaceCryptographicMaterials
-
dataKey
public SecretKey dataKey()
- Specified by:
dataKeyin interfaceCryptographicMaterials
-
cryptoProvider
public Provider cryptoProvider()
- Specified by:
cryptoProviderin interfaceCryptographicMaterials
-
cipherMode
public CipherMode cipherMode()
- Specified by:
cipherModein interfaceCryptographicMaterials
-
-