|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.amazonaws.services.s3.internal.crypto.EncryptionUtils
public class EncryptionUtils
The EncryptionUtils class encrypts and decrypts data stored in S3. It can be used to prepare requests for encryption before they are stored in S3 and to decrypt objects that are retrieved from S3.
Constructor Summary | |
---|---|
EncryptionUtils()
|
Method Summary | |
---|---|
static S3Object |
adjustOutputToDesiredRange(S3Object object,
long[] range)
Adjusts the retrieved S3Object so that the object contents contain only the range of bytes desired by the user. |
static EncryptionInstruction |
buildInstructionFromInstructionFile(S3Object instructionFile,
EncryptionMaterials materials,
Provider cryptoProvider)
Builds an instruction object from the contents of an instruction file. |
static DeleteObjectRequest |
createInstructionDeleteObjectRequest(DeleteObjectRequest request)
Creates a delete request to delete an instruction file in S3. |
static GetObjectRequest |
createInstructionGetRequest(GetObjectRequest request)
Creates a get request to retrieve an instruction file from S3. |
static PutObjectRequest |
createInstructionPutRequest(PutObjectRequest request,
EncryptionInstruction instruction)
Creates a put request to store the specified instruction object in S3. |
static S3Object |
decryptObjectUsingInstruction(S3Object object,
EncryptionInstruction instruction)
Returns an updated object where the object content input stream contains the decrypted contents. |
static S3Object |
decryptObjectUsingMetadata(S3Object object,
EncryptionMaterials materials,
Provider cryptoProvider)
Returns an updated object where the object content input stream contains the decrypted contents. |
static PutObjectRequest |
encryptRequestUsingInstruction(PutObjectRequest request,
EncryptionInstruction instruction)
Returns an updated request where the input stream contains the encrypted object contents. |
static PutObjectRequest |
encryptRequestUsingMetadata(PutObjectRequest request,
EncryptionMaterials materials,
Provider cryptoProvider)
Returns an updated request where the metadata contains encryption information and the input stream contains the encrypted object contents. |
static EncryptionInstruction |
generateInstruction(PutObjectRequest putObjectRequest,
EncryptionMaterials materials,
Provider cryptoProvider)
Generates an instruction that will be used to encrypt an object. |
static long[] |
getAdjustedCryptoRange(long[] range)
Adjusts a user specified range to retrieve all of the cipher blocks (each of size 16 bytes) that contain the specified range. |
static boolean |
isEncryptionInfoInInstructionFile(S3Object instructionFile)
Returns true if the specified S3Object is an instruction file containing encryption info, false otherwise. |
static boolean |
isEncryptionInfoInMetadata(S3Object retrievedObject)
Returns true if the specified S3Object contains encryption info in its metadata, false otherwise. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public EncryptionUtils()
Method Detail |
---|
public static PutObjectRequest encryptRequestUsingMetadata(PutObjectRequest request, EncryptionMaterials materials, Provider cryptoProvider)
request
- The request whose contents are to be encrypted.materials
- The encryption materials to be used to encrypt and decrypt data.cryptoProvider
- The crypto provider whose encryption implementation will be used to encrypt data
public static S3Object decryptObjectUsingMetadata(S3Object object, EncryptionMaterials materials, Provider cryptoProvider)
object
- The object whose contents are to be decrypted.materials
- The encryption materials to be used to encrypt and decrypt data.cryptoProvider
- The crypto provider whose encryption implementation will be used to decrypt data
public static EncryptionInstruction generateInstruction(PutObjectRequest putObjectRequest, EncryptionMaterials materials, Provider cryptoProvider)
putObjectRequest
- The request whose contents are to be encrypted.materials
- The encryption materials to be used to encrypt and decrypt data.cryptoProvider
- The crypto provider whose encryption implementation will be used to encrypt and decrypt data.
public static EncryptionInstruction buildInstructionFromInstructionFile(S3Object instructionFile, EncryptionMaterials materials, Provider cryptoProvider)
instructionFile
- An instruction file retrieved from S3 that contains encryption informationmaterials
- The encryption materials to be used to encrypt and decrypt data.cryptoProvider
- The crypto provider whose encryption implementation will be used to encrypt and decrypt data.
public static PutObjectRequest encryptRequestUsingInstruction(PutObjectRequest request, EncryptionInstruction instruction)
request
- The request whose contents are to be encrypted.instruction
- The instruction that will be used to encrypt the object data.
public static S3Object decryptObjectUsingInstruction(S3Object object, EncryptionInstruction instruction)
object
- The object whose contents are to be decrypted.instruction
- The instruction that will be used to decrypt the object data.
public static PutObjectRequest createInstructionPutRequest(PutObjectRequest request, EncryptionInstruction instruction)
request
- The put request for the original object to be stored in S3.instruction
- The instruction object to be stored in S3.
public static GetObjectRequest createInstructionGetRequest(GetObjectRequest request)
request
- The get request for the original object to be retrieved from S3.
public static DeleteObjectRequest createInstructionDeleteObjectRequest(DeleteObjectRequest request)
request
- The delete request for the original object to be deleted from S3.
public static boolean isEncryptionInfoInMetadata(S3Object retrievedObject)
retrievedObject
- An S3Object
public static boolean isEncryptionInfoInInstructionFile(S3Object instructionFile)
instructionFile
- An S3Object that may potentially be an instruction file
public static long[] getAdjustedCryptoRange(long[] range)
range
- A two-element array of longs corresponding to the start and finish (inclusive) of a desired
range of bytes.
public static S3Object adjustOutputToDesiredRange(S3Object object, long[] range)
object
- The S3Object retrieved from S3 that could possibly contain more bytes than desired
by the user.range
- A two-element array of longs corresponding to the start and finish (inclusive) of a desired
range of bytes.
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |