Skip to content

Conversation

siujamo
Copy link
Contributor

@siujamo siujamo commented Jun 9, 2025

  • Import RSA public key with modulus and exponent;
  • Import EC public key with x, y and curve name.

@siujamo siujamo requested review from zihluwang and Copilot June 9, 2025 10:01
@siujamo siujamo self-assigned this Jun 9, 2025
@siujamo siujamo added the enhancement New feature or request label Jun 9, 2025
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR improves key loading functionality by introducing new methods for importing RSA and EC public keys based on provided key components.

  • Updated AuthzeroTokenResolver to use the newly renamed ECKeyLoader.
  • Renamed and enhanced RSAKeyLoader and ECKeyLoader to support key import via modulus/exponent and x/y/curve parameters respectively.
  • Updated the KeyLoader interface to include default methods for RSA and EC public key loading.

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
simple-jwt-authzero/src/main/java/com/onixbyte/simplejwt/authzero/AuthzeroTokenResolver.java Updated import and instantiation to use ECKeyLoader.
key-pair-loader/src/main/java/com/onixbyte/security/impl/RSAKeyLoader.java Renamed class and added RSA public key loading from modulus/exponent.
key-pair-loader/src/main/java/com/onixbyte/security/impl/ECKeyLoader.java Renamed class and added EC public key loading from x, y coordinates and curve name.
key-pair-loader/src/main/java/com/onixbyte/security/KeyLoader.java Added default methods for RSA and EC public key loading.
Comments suppressed due to low confidence (1)

key-pair-loader/src/main/java/com/onixbyte/security/impl/RSAKeyLoader.java:152

  • [nitpick] Local variable names with a leading underscore (e.g., '_modulus' and similarly for '_exponent') are unconventional in Java. Consider renaming them (e.g., 'modulusBigInt' and 'exponentBigInt') to improve readability.
var _modulus = new BigInteger(1, urlDecoder.decode(modulus));

@zihluwang zihluwang merged commit 81ade8f into develop Jun 9, 2025
Copy link
Member

@zihluwang zihluwang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@siujamo good to go

@zihluwang zihluwang deleted the feature/key-loader branch June 9, 2025 11:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants