T
- class type.AmazonS3EncryptionClient
for further details.@Deprecated public abstract class S3CryptoModuleBase<T extends com.amazonaws.services.s3.internal.crypto.MultipartUploadCryptoContext> extends S3CryptoModule<T>
Modifier and Type | Field and Description |
---|---|
protected com.amazonaws.services.s3.internal.crypto.ContentCryptoScheme |
contentCryptoScheme
Deprecated.
|
protected CryptoConfiguration |
cryptoConfig
Deprecated.
A read-only copy of the crypto configuration.
|
protected com.amazonaws.services.s3.internal.crypto.S3CryptoScheme |
cryptoScheme
Deprecated.
|
protected static int |
DEFAULT_BUFFER_SIZE
Deprecated.
|
protected EncryptionMaterialsProvider |
kekMaterialsProvider
Deprecated.
|
protected com.amazonaws.services.kms.AWSKMSClient |
kms
Deprecated.
|
protected com.amazonaws.logging.Log |
log
Deprecated.
|
protected java.util.Map<java.lang.String,T> |
multipartUploadContexts
Deprecated.
Map of data about in progress encrypted multipart uploads.
|
protected S3Direct |
s3
Deprecated.
|
Modifier | Constructor and Description |
---|---|
protected |
S3CryptoModuleBase(com.amazonaws.services.kms.AWSKMSClient kms,
S3Direct s3,
com.amazonaws.auth.AWSCredentialsProvider credentialsProvider,
EncryptionMaterialsProvider kekMaterialsProvider,
CryptoConfiguration cryptoConfig)
Deprecated.
|
protected |
S3CryptoModuleBase(S3Direct s3,
com.amazonaws.auth.AWSCredentialsProvider credentialsProvider,
EncryptionMaterialsProvider kekMaterialsProvider,
CryptoConfiguration cryptoConfig)
Deprecated.
For testing purposes only.
|
Modifier and Type | Method and Description |
---|---|
void |
abortMultipartUploadSecurely(AbortMultipartUploadRequest req)
Deprecated.
|
protected abstract long |
ciphertextLength(long plaintextLength)
Deprecated.
Returns the length of the ciphertext computed from the length of the
plaintext.
|
CompleteMultipartUploadResult |
completeMultipartUploadSecurely(CompleteMultipartUploadRequest req)
Deprecated.
|
CopyPartResult |
copyPartSecurely(CopyPartRequest copyPartRequest)
Deprecated.
|
protected com.amazonaws.services.s3.internal.crypto.ContentCryptoMaterial |
createContentCryptoMaterial(com.amazonaws.AmazonWebServiceRequest req)
Deprecated.
Creates and returns a non-null content crypto material for the given
request.
|
protected PutObjectRequest |
createInstructionPutRequest(java.lang.String bucketName,
java.lang.String key,
com.amazonaws.services.s3.internal.crypto.ContentCryptoMaterial cekMaterial)
Deprecated.
|
protected javax.crypto.SecretKey |
generateCEK(EncryptionMaterials kekMaterials,
java.security.Provider providerIn)
Deprecated.
|
com.amazonaws.services.s3.internal.crypto.S3CryptoScheme |
getS3CryptoScheme()
Deprecated.
|
InitiateMultipartUploadResult |
initiateMultipartUploadSecurely(InitiateMultipartUploadRequest req)
Deprecated.
|
protected CipherLiteInputStream |
newMultipartS3CipherInputStream(UploadPartRequest req,
com.amazonaws.services.s3.internal.crypto.CipherLite cipherLite)
Deprecated.
|
protected long |
plaintextLength(AbstractPutObjectRequest request,
ObjectMetadata metadata)
Deprecated.
Returns the plaintext length from the request and metadata; or -1 if
unknown.
|
PutObjectResult |
putInstructionFileSecurely(PutInstructionFileRequest req)
Deprecated.
|
void |
putLocalObjectSecurely(UploadObjectRequest reqIn,
java.lang.String uploadId,
java.io.OutputStream os)
Deprecated.
|
PutObjectResult |
putObjectSecurely(PutObjectRequest req)
Deprecated.
|
protected void |
securityCheck(com.amazonaws.services.s3.internal.crypto.ContentCryptoMaterial cekMaterial,
com.amazonaws.services.s3.internal.crypto.S3ObjectWrapper retrieved)
Deprecated.
Checks if the the crypto scheme used in the given content crypto material
is allowed to be used in this crypto module.
|
protected PutObjectRequest |
updateInstructionPutRequest(PutObjectRequest req,
com.amazonaws.services.s3.internal.crypto.ContentCryptoMaterial cekMaterial)
Deprecated.
Updates put request to store the specified instruction object in S3.
|
protected ObjectMetadata |
updateMetadataWithContentCryptoMaterial(ObjectMetadata metadata,
java.io.File file,
com.amazonaws.services.s3.internal.crypto.ContentCryptoMaterial instruction)
Deprecated.
|
UploadPartResult |
uploadPartSecurely(UploadPartRequest req)
Deprecated.
|
protected <R extends AbstractPutObjectRequest> |
wrapWithCipher(R request,
com.amazonaws.services.s3.internal.crypto.ContentCryptoMaterial cekMaterial)
Deprecated.
Returns the given
PutObjectRequest but has the content as
input stream wrapped with a cipher, and configured with some meta data
and user metadata. |
getObjectSecurely, getObjectSecurely
protected static final int DEFAULT_BUFFER_SIZE
protected final EncryptionMaterialsProvider kekMaterialsProvider
protected final com.amazonaws.logging.Log log
protected final com.amazonaws.services.s3.internal.crypto.S3CryptoScheme cryptoScheme
protected final com.amazonaws.services.s3.internal.crypto.ContentCryptoScheme contentCryptoScheme
protected final CryptoConfiguration cryptoConfig
protected final java.util.Map<java.lang.String,T extends com.amazonaws.services.s3.internal.crypto.MultipartUploadCryptoContext> multipartUploadContexts
protected final S3Direct s3
protected final com.amazonaws.services.kms.AWSKMSClient kms
protected S3CryptoModuleBase(com.amazonaws.services.kms.AWSKMSClient kms, S3Direct s3, com.amazonaws.auth.AWSCredentialsProvider credentialsProvider, EncryptionMaterialsProvider kekMaterialsProvider, CryptoConfiguration cryptoConfig)
cryptoConfig
- a read-only copy of the crypto configuration.protected S3CryptoModuleBase(S3Direct s3, com.amazonaws.auth.AWSCredentialsProvider credentialsProvider, EncryptionMaterialsProvider kekMaterialsProvider, CryptoConfiguration cryptoConfig)
protected abstract long ciphertextLength(long plaintextLength)
plaintextLength
- a non-negative numberpublic PutObjectResult putObjectSecurely(PutObjectRequest req)
putObjectSecurely
in class S3CryptoModule<T extends com.amazonaws.services.s3.internal.crypto.MultipartUploadCryptoContext>
req
- the PutObjectRequest.public final void abortMultipartUploadSecurely(AbortMultipartUploadRequest req)
abortMultipartUploadSecurely
in class S3CryptoModule<T extends com.amazonaws.services.s3.internal.crypto.MultipartUploadCryptoContext>
req
- the AbortMultipartUploadRequest.public final CopyPartResult copyPartSecurely(CopyPartRequest copyPartRequest)
copyPartSecurely
in class S3CryptoModule<T extends com.amazonaws.services.s3.internal.crypto.MultipartUploadCryptoContext>
copyPartRequest
- the CopyPartRequest.public InitiateMultipartUploadResult initiateMultipartUploadSecurely(InitiateMultipartUploadRequest req)
initiateMultipartUploadSecurely
in class S3CryptoModule<T extends com.amazonaws.services.s3.internal.crypto.MultipartUploadCryptoContext>
req
- the InitiateMultipartUploadRequest.public UploadPartResult uploadPartSecurely(UploadPartRequest req)
NOTE: Because the encryption process requires context from previous blocks, parts uploaded with the AmazonS3EncryptionClient (as opposed to the normal AmazonS3Client) must be uploaded serially, and in order. Otherwise, the previous encryption context isn't available to use when encrypting the current part.
uploadPartSecurely
in class S3CryptoModule<T extends com.amazonaws.services.s3.internal.crypto.MultipartUploadCryptoContext>
req
- the UploadPartRequest.protected final CipherLiteInputStream newMultipartS3CipherInputStream(UploadPartRequest req, com.amazonaws.services.s3.internal.crypto.CipherLite cipherLite)
public CompleteMultipartUploadResult completeMultipartUploadSecurely(CompleteMultipartUploadRequest req)
completeMultipartUploadSecurely
in class S3CryptoModule<T extends com.amazonaws.services.s3.internal.crypto.MultipartUploadCryptoContext>
req
- the CompleteMultipartUploadRequest.protected final ObjectMetadata updateMetadataWithContentCryptoMaterial(ObjectMetadata metadata, java.io.File file, com.amazonaws.services.s3.internal.crypto.ContentCryptoMaterial instruction)
protected final com.amazonaws.services.s3.internal.crypto.ContentCryptoMaterial createContentCryptoMaterial(com.amazonaws.AmazonWebServiceRequest req)
com.amazonaws.AmazonClientException
- if no encryption material can be found.public final void putLocalObjectSecurely(UploadObjectRequest reqIn, java.lang.String uploadId, java.io.OutputStream os) throws java.io.IOException
putLocalObjectSecurely
in class S3CryptoModule<T extends com.amazonaws.services.s3.internal.crypto.MultipartUploadCryptoContext>
reqIn
- the UploadObjectRequest.uploadId
- multipart upload id.os
- output stream which will be closed upon method completion.java.io.IOException
protected final javax.crypto.SecretKey generateCEK(EncryptionMaterials kekMaterials, java.security.Provider providerIn)
kekMaterials
- non-null encryption materialsprotected final <R extends AbstractPutObjectRequest> R wrapWithCipher(R request, com.amazonaws.services.s3.internal.crypto.ContentCryptoMaterial cekMaterial)
PutObjectRequest
but has the content as
input stream wrapped with a cipher, and configured with some meta data
and user metadata.protected final long plaintextLength(AbstractPutObjectRequest request, ObjectMetadata metadata)
public final com.amazonaws.services.s3.internal.crypto.S3CryptoScheme getS3CryptoScheme()
protected final PutObjectRequest updateInstructionPutRequest(PutObjectRequest req, com.amazonaws.services.s3.internal.crypto.ContentCryptoMaterial cekMaterial)
req
- The put-instruction-file request for the instruction file to
be stored in S3.cekMaterial
- The instruction object to be stored in S3.protected final PutObjectRequest createInstructionPutRequest(java.lang.String bucketName, java.lang.String key, com.amazonaws.services.s3.internal.crypto.ContentCryptoMaterial cekMaterial)
protected void securityCheck(com.amazonaws.services.s3.internal.crypto.ContentCryptoMaterial cekMaterial, com.amazonaws.services.s3.internal.crypto.S3ObjectWrapper retrieved)
java.lang.SecurityException
- if the crypto scheme used in the given content crypto
material is not allowed in this crypto module.public final PutObjectResult putInstructionFileSecurely(PutInstructionFileRequest req)
putInstructionFileSecurely
in class S3CryptoModule<T extends com.amazonaws.services.s3.internal.crypto.MultipartUploadCryptoContext>
req
- the PutInstructionFileRequest.EncryptedGetObjectRequest
.