22 lines
479 B
C#
22 lines
479 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace SecureCore.Authentication
|
|
{
|
|
public class SessionManager
|
|
{
|
|
private static int SessionKeySize { get; } = 32; //32 bytes
|
|
|
|
public static string CreateSessionToken()
|
|
{
|
|
var token = new byte[SessionKeySize];
|
|
|
|
ByteGenerator.GetRandomBytes(ref token);
|
|
|
|
return Convert.ToBase64String(token);
|
|
}
|
|
}
|
|
}
|