Skip to content
Branch: master
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
26 lines (25 sloc) 672 Bytes
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Cryptography;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
namespace ASPNetCoreJWTSample.Controllers
public class KeyGenController : ControllerBase
public IActionResult GenerateKey()
using (var rng = new RNGCryptoServiceProvider())
var key = new byte[64];
return Ok(Convert.ToBase64String(key));
You can’t perform that action at this time.