private void GenerateEncryptedObjectRequestUsingMetadata(PutObjectRequest putObjectRequest)
{
// Create instruction
EncryptionInstructions instructions = EncryptionUtils.GenerateInstructions(this.encryptionMaterials);
EncryptionUtils.AddUnencryptedContentLengthToMetadata(putObjectRequest);
// Encrypt the object data with the instruction
putObjectRequest.InputStream = EncryptionUtils.EncryptRequestUsingInstruction(putObjectRequest.InputStream, instructions);
// Update the metadata
EncryptionUtils.UpdateMetadataWithEncryptionInstructions(putObjectRequest, instructions);
}