public async Task <BinaryData> ClientSideEncryptInternal(BinaryData messageToUpload, bool async, CancellationToken cancellationToken)
        {
            byte[] bytesToEncrypt = messageToUpload.ToArray();
            (byte[] ciphertext, EncryptionData encryptionData) = await _encryptor.BufferedEncryptInternal(
                new MemoryStream(bytesToEncrypt),
                async,
                cancellationToken).ConfigureAwait(false);

            return(EncryptedMessageSerializer.Serialize(new EncryptedMessage
            {
                EncryptedMessageText = Convert.ToBase64String(ciphertext),
                EncryptionData = encryptionData
            }));
        }
        public async Task <string> ClientSideEncryptInternal(string messageToUpload, bool async, CancellationToken cancellationToken)
        {
            var bytesToEncrypt = Encoding.UTF8.GetBytes(messageToUpload);

            (byte[] ciphertext, EncryptionData encryptionData) = await _encryptor.BufferedEncryptInternal(
                new MemoryStream(bytesToEncrypt),
                async,
                cancellationToken).ConfigureAwait(false);

            return(EncryptedMessageSerializer.Serialize(new EncryptedMessage
            {
                EncryptedMessageText = Convert.ToBase64String(ciphertext),
                EncryptionData = encryptionData
            }));
        }