OpenSSL.Core.Native.RAND_bytes C# (CSharp) Method

RAND_bytes() private method

private RAND_bytes ( byte buf, int num ) : int
buf byte
num int
return int
        public static extern int RAND_bytes(byte[] buf, int num);

Usage Example

Example #1
0
        /// <summary>
        /// Calls RAND_bytes()
        /// </summary>
        /// <param name="len"></param>
        /// <returns></returns>
        public static byte[] Bytes(int len)
        {
            var buf = new byte[len];

            Native.ExpectSuccess(Native.RAND_bytes(buf, len));

            return(buf);
        }
Native