Amazon.S3.Encryption.EncryptionUtils.DecryptObjectUsingInstructions C# (CSharp) Method

DecryptObjectUsingInstructions() static private method

Updates object where the object input stream contains the decrypted contents.
static private DecryptObjectUsingInstructions ( GetObjectResponse response, EncryptionInstructions instructions ) : void
response Amazon.S3.Model.GetObjectResponse /// The getObject response whose contents are to be decrypted. ///
instructions EncryptionInstructions /// The instruction that will be used to encrypt the object data. ///
return void
        internal static void DecryptObjectUsingInstructions(GetObjectResponse response, EncryptionInstructions instructions)
        {
            response.ResponseStream = DecryptStream(response.ResponseStream, instructions);
        }

Usage Example

        /// <summary>
        /// Updates object where the object input stream contains the decrypted contents.
        /// </summary>
        /// <param name="objectResponse">
        /// The getObject response whose contents are to be decrypted.
        /// </param>
        private void DecryptObjectUsingMetadata(GetObjectResponse objectResponse)
        {
            // Create an instruction object from the object metadata
            EncryptionInstructions instructions = EncryptionUtils.BuildInstructionsFromObjectMetadata(objectResponse, this.encryptionMaterials);

            // Decrypt the object with the instruction
            EncryptionUtils.DecryptObjectUsingInstructions(objectResponse, instructions);
        }
All Usage Examples Of Amazon.S3.Encryption.EncryptionUtils::DecryptObjectUsingInstructions