using IdentityShroud.Core.Messages; namespace IdentityShroud.Core.Security.Keys; public class KeyPolicy { public KeyType KeyType { get; protected init; } public int KeySize { get; protected init; } } public record KeyData(byte[] PrivateKey, Dictionary? PublicKeyParameters = null) { /// /// The data to be kept private, also used for symmetric keys /// public byte[] PrivateKey { get; set; } = PrivateKey; public Dictionary? PublicKeyParameters { get; set; } = PublicKeyParameters; } public interface IKeyProvider { /// /// Returns true when this key uses public key cryptography /// bool IsPublic { get; } KeyData CreateKey(KeyPolicy policy); void SetJwkParameters(Dictionary parameters, JsonWebKey jwk); }