/// <summary> /// Returns an updated input stream where the input stream contains the encrypted object contents. /// The specified instruction will be used to encrypt data. /// </summary> /// <param name="toBeEncrypted"> /// The stream whose contents are to be encrypted. /// </param> /// <param name="instructions"> /// The instruction that will be used to encrypt the object data. /// </param> /// <returns> /// Encrypted stream, i.e input stream wrapped into encrypted stream /// </returns> internal static Stream EncryptUploadPartRequestUsingInstructions(Stream toBeEncrypted, EncryptionInstructions instructions) { //wrap input stream into AESEncryptionStreamForUploadPart wrapper AESEncryptionUploadPartStream aesEStream; aesEStream = new AESEncryptionUploadPartStream(toBeEncrypted, instructions.EnvelopeKey, instructions.InitializationVector); return(aesEStream); }
/// <summary> /// Returns an updated input stream where the input stream contains the encrypted object contents. /// The specified instruction will be used to encrypt data. /// </summary> /// <param name="toBeEncrypted"> /// The stream whose contents are to be encrypted. /// </param> /// <param name="instructions"> /// The instruction that will be used to encrypt the object data. /// </param> /// <returns> /// Encrypted stream, i.e input stream wrapped into encrypted stream /// </returns> internal static Stream EncryptUploadPartRequestUsingInstructions(Stream toBeEncrypted, EncryptionInstructions instructions) { //wrap input stream into AESEncryptionStreamForUploadPart wrapper AESEncryptionUploadPartStream aesEStream; aesEStream = new AESEncryptionUploadPartStream(toBeEncrypted, instructions.EnvelopeKey, instructions.InitializationVector); return aesEStream; }