Skip to content

Commit 15dfa29

Browse files
authored
Fix use of CryptoStream examples (#10470)
1 parent 77ee1b1 commit 15dfa29

File tree

4 files changed

+10
-6
lines changed

4 files changed

+10
-6
lines changed

snippets/csharp/System.Security.Cryptography/Aes/Overview/program.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,9 @@ static byte[] EncryptStringToBytes_Aes(string plainText, byte[] Key, byte[] IV)
6060
//Write all data to the stream.
6161
swEncrypt.Write(plainText);
6262
}
63-
encrypted = msEncrypt.ToArray();
6463
}
64+
65+
encrypted = msEncrypt.ToArray();
6566
}
6667
}
6768

snippets/csharp/System.Security.Cryptography/AesCryptoServiceProvider/Overview/program.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,9 @@ static byte[] EncryptStringToBytes_Aes(string plainText, byte[] Key, byte[] IV)
5959
//Write all data to the stream.
6060
swEncrypt.Write(plainText);
6161
}
62-
encrypted = msEncrypt.ToArray();
6362
}
63+
64+
encrypted = msEncrypt.ToArray();
6465
}
6566
}
6667

@@ -115,4 +116,4 @@ static string DecryptStringFromBytes_Aes(byte[] cipherText, byte[] Key, byte[] I
115116
//</Snippet3>
116117
}
117118
}
118-
//</Snippet1>
119+
//</Snippet1>

snippets/csharp/System.Security.Cryptography/AesManaged/Overview/program.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,9 @@ static byte[] EncryptStringToBytes_Aes(string plainText, byte[] Key, byte[] IV)
5959
//Write all data to the stream.
6060
swEncrypt.Write(plainText);
6161
}
62-
encrypted = msEncrypt.ToArray();
6362
}
63+
64+
encrypted = msEncrypt.ToArray();
6465
}
6566
}
6667

@@ -115,4 +116,4 @@ static string DecryptStringFromBytes_Aes(byte[] cipherText, byte[] Key, byte[] I
115116
//</Snippet3>
116117
}
117118
}
118-
//</Snippet1>
119+
//</Snippet1>

snippets/csharp/System.Security.Cryptography/RijndaelManaged/Overview/class1.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,9 @@ static byte[] EncryptStringToBytes(string plainText, byte[] Key, byte[] IV)
7070
//Write all data to the stream.
7171
swEncrypt.Write(plainText);
7272
}
73-
encrypted = msEncrypt.ToArray();
7473
}
74+
75+
encrypted = msEncrypt.ToArray();
7576
}
7677
}
7778

0 commit comments

Comments
 (0)