Skip to content
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

Enabling symmetric and asymmetric keys to be created publicly with JWK #3089

Merged
merged 4 commits into from
Jan 12, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion src/Microsoft.IdentityModel.Tokens/JsonWebKeyConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -199,8 +199,16 @@ public static JsonWebKey ConvertFromECDsaSecurityKey(ECDsaSecurityKey key)
}
#endif

internal static bool TryConvertToSecurityKey(JsonWebKey webKey, out SecurityKey key)
/// <summary>
/// This will attempt to convert the <see cref="JsonWebKey"/> to a <see cref="SecurityKey"/>.
/// </summary>
/// <param name="webKey"><see cref="JsonWebKey"/></param>
/// <param name="key"><see cref="SecurityKey"/></param>
public static bool TryConvertToSecurityKey(JsonWebKey webKey, out SecurityKey key)
{
if (webKey == null)
throw LogHelper.LogArgumentNullException(nameof(webKey));

if (webKey.ConvertedSecurityKey != null)
{
key = webKey.ConvertedSecurityKey;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
Microsoft.IdentityModel.Tokens.SecurityTokenDescriptor.IncludeKeyIdInHeader.get -> bool
Microsoft.IdentityModel.Tokens.SecurityTokenDescriptor.IncludeKeyIdInHeader.set -> void
static Microsoft.IdentityModel.Tokens.JsonWebKeyConverter.TryConvertToSecurityKey(Microsoft.IdentityModel.Tokens.JsonWebKey webKey, out Microsoft.IdentityModel.Tokens.SecurityKey key) -> bool
Loading