File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
src/Renci.SshNet/Abstractions Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,18 @@ internal static class CryptoAbstraction
9
9
private static readonly System . Security . Cryptography . RandomNumberGenerator Randomizer = CreateRandomNumberGenerator ( ) ;
10
10
#endif
11
11
12
+ /// <summary>
13
+ /// Generates a <see cref="Byte"/> array of the specified length, and fills it with a
14
+ /// cryptographically strong random sequence of values.
15
+ /// </summary>
16
+ /// <param name="length">The length of the array generate.</param>
17
+ public static byte [ ] GenerateRandom ( int length )
18
+ {
19
+ var random = new byte [ length ] ;
20
+ GenerateRandom ( random ) ;
21
+ return random ;
22
+ }
23
+
12
24
/// <summary>
13
25
/// Fills an array of bytes with a cryptographically strong random sequence of values.
14
26
/// </summary>
You can’t perform that action at this time.
0 commit comments