Fixes some warnings.

This commit is contained in:
eelke 2026-02-14 14:54:48 +01:00
parent d440979451
commit ed52e2f789
3 changed files with 25 additions and 17 deletions

View file

@ -2,26 +2,31 @@ using System.Text.Json.Serialization;
namespace IdentityShroud.Core.Messages;
// https://www.rfc-editor.org/rfc/rfc7517.html
public class JsonWebKey
{
[JsonPropertyName("kty")]
public string KeyType { get; set; } = "RSA";
// Common values sig(nature) enc(ryption)
[JsonPropertyName("use")]
public string Use { get; set; } = "sig"; // "sig" for signature, "enc" for encryption
public string? Use { get; set; } = "sig"; // "sig" for signature, "enc" for encryption
// Per standard this field is optional for now we will use RS256
[JsonPropertyName("alg")]
public string Algorithm { get; set; } = "RS256";
public string? Algorithm { get; set; } = "RS256";
[JsonPropertyName("kid")]
public string KeyId { get; set; }
public required string KeyId { get; set; }
// RSA Public Key Components
[JsonPropertyName("n")]
public string Modulus { get; set; }
public required string Modulus { get; set; }
[JsonPropertyName("e")]
public string Exponent { get; set; }
public required string Exponent { get; set; }
// Optional fields
[JsonPropertyName("x5c")]