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 class
MultipartUploadMaterials.Builder
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description AlgorithmSuite
algorithmSuite()
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.static MultipartUploadMaterials.Builder
builder()
CipherMode
cipherMode()
Provider
cryptoProvider()
SecretKey
dataKey()
Map<String,String>
encryptionContext()
Note that the underlying implementation uses a Collections.unmodifiableMap which is immutable.protected void
endPartUpload()
Used to mark the completion of a part upload before the next.Cipher
getCipher(byte[] iv)
When calling with an IV, sanity check that the given IV matches the one in the cipher.byte[]
getIv()
boolean
hasFinalPartBeenSeen()
software.amazon.awssdk.services.s3.model.S3Request
s3Request()
void
setHasFinalPartBeenSeen(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:
getCipher
in 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
partUploadInProgress
will 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:
algorithmSuite
in interfaceCryptographicMaterials
-
s3Request
public software.amazon.awssdk.services.s3.model.S3Request s3Request()
- Specified by:
s3Request
in interfaceCryptographicMaterials
-
encryptionContext
public Map<String,String> encryptionContext()
Note that the underlying implementation uses a Collections.unmodifiableMap which is immutable.- Specified by:
encryptionContext
in interfaceCryptographicMaterials
-
dataKey
public SecretKey dataKey()
- Specified by:
dataKey
in interfaceCryptographicMaterials
-
cryptoProvider
public Provider cryptoProvider()
- Specified by:
cryptoProvider
in interfaceCryptographicMaterials
-
cipherMode
public CipherMode cipherMode()
- Specified by:
cipherMode
in interfaceCryptographicMaterials
-
-