var key = <contents of p8 file>;
var credentials = new SigningCredentials(
new SymmetricSecurityKey(Encoding.ASCII.GetBytes(key)),
SecurityAlgorithms.EcdsaSha256
var header = new JwtHeader(credentials);
header.Add("kid", KeyID);
var payload = new JwtPayload
{ "aud ", "appstoreconnect-v1"},
{ "exp", exp},