-
Notifications
You must be signed in to change notification settings - Fork 464
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added support for JSON Web key sets #489
base: main
Are you sure you want to change the base?
Changes from 35 commits
9c40aa9
79ea39a
923f90c
72613d2
0f1d3bb
bcade65
9a76799
3b6b542
c64bd7b
06be06c
fc30b3f
20e3d51
528bc73
31ea350
f74489f
e8d36db
173a5aa
28afdb6
be352ca
4ad94e9
61cfe50
25ce0e1
ab3b341
67a88fa
de808ee
5b3c309
eac7e11
564d4e1
ea878af
8848445
3f08528
47e9234
7e09d4b
1e8cd93
e5f9f61
a8c1651
90f02d8
80eb529
d48dee1
1a3a717
89cc32f
37aafbb
a66322b
6dd5743
e7189c1
c57a9a0
58e9a99
a80e41e
0112fef
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
namespace JWT.Algorithms | ||
{ | ||
/// <summary> | ||
/// Represents a symmetric algorithm to generate or validate JWT signature. | ||
/// </summary> | ||
public interface ISymmetricAlgorithm : IJwtAlgorithm | ||
{ | ||
byte[] Key { get; } | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
using System; | ||
|
||
namespace JWT.Exceptions | ||
{ | ||
public class InvalidJsonWebKeyEllipticCurveTypeException : ArgumentOutOfRangeException | ||
{ | ||
public InvalidJsonWebKeyEllipticCurveTypeException(string ellipticCurveType) | ||
: base($"{ellipticCurveType} is not defined in RFC751") | ||
{ | ||
|
||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
using System; | ||
|
||
namespace JWT.Exceptions | ||
{ | ||
public class InvalidJsonWebKeyTypeException : ArgumentOutOfRangeException | ||
{ | ||
public InvalidJsonWebKeyTypeException(string keyType) | ||
: base($"{keyType} is not defined in RFC7518") | ||
{ | ||
|
||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
namespace JWT.Jwk | ||
{ | ||
public interface IJwtWebKeysCollection | ||
{ | ||
JwtWebKey Find(string keyId); | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
namespace JWT.Jwk; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please convert implicit namespace into explicit (here and elsewhere too), for the consistency of the codebase There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oops. sorry. This is the only place with implicit namespace (my bad, miss it). Fixed |
||
|
||
public interface IJwtWebKeysCollectionFactory | ||
{ | ||
JwtWebKeysCollection CreateKeys(); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do all classes need an empty ctor? Both the algos and the factories?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't want to introduce breaking changes for the user code like:
I can remove empty ctors if you want to