Skip to content

Commit 6ac9f1a

Browse files
committed
refactor: renamed key pair loader
1 parent 579a2e2 commit 6ac9f1a

File tree

3 files changed

+6
-8
lines changed

3 files changed

+6
-8
lines changed

key-pair-loader/src/main/java/com/onixbyte/security/impl/EcKeyLoader.java renamed to key-pair-loader/src/main/java/com/onixbyte/security/impl/ECKeyLoader.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
* @version 2.0.0
5454
* @since 2.0.0
5555
*/
56-
public class EcKeyLoader implements KeyLoader {
56+
public class ECKeyLoader implements KeyLoader {
5757

5858
private final KeyFactory keyFactory;
5959

@@ -62,7 +62,7 @@ public class EcKeyLoader implements KeyLoader {
6262
/**
6363
* Initialise a key loader for EC-based algorithms.
6464
*/
65-
public EcKeyLoader() {
65+
public ECKeyLoader() {
6666
try {
6767
this.keyFactory = KeyFactory.getInstance("EC");
6868
this.decoder = Base64.getDecoder();

key-pair-loader/src/main/java/com/onixbyte/security/impl/RsaKeyLoader.java renamed to key-pair-loader/src/main/java/com/onixbyte/security/impl/RSAKeyLoader.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
* @see KeyLoader
4545
* @see KeyLoadingException
4646
*/
47-
public class RsaKeyLoader implements KeyLoader {
47+
public class RSAKeyLoader implements KeyLoader {
4848

4949
private final Base64.Decoder decoder;
5050
private final KeyFactory keyFactory;
@@ -55,7 +55,7 @@ public class RsaKeyLoader implements KeyLoader {
5555
* This constructor initialises the Base64 decoder and the RSA {@link KeyFactory}. It may throw
5656
* a {@link KeyLoadingException} if the RSA algorithm is not available.
5757
*/
58-
public RsaKeyLoader() {
58+
public RSAKeyLoader() {
5959
try {
6060
this.decoder = Base64.getDecoder();
6161
this.keyFactory = KeyFactory.getInstance("RSA");

simple-jwt-authzero/src/main/java/com/onixbyte/simplejwt/authzero/AuthzeroTokenResolver.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@
1919

2020
import com.onixbyte.devkit.utils.Base64Util;
2121
import com.onixbyte.guid.GuidCreator;
22-
import com.onixbyte.security.KeyLoader;
23-
import com.onixbyte.security.impl.EcKeyLoader;
22+
import com.onixbyte.security.impl.ECKeyLoader;
2423
import com.onixbyte.simplejwt.TokenPayload;
2524
import com.onixbyte.simplejwt.TokenResolver;
2625
import com.onixbyte.simplejwt.annotations.ExcludeFromPayload;
@@ -43,7 +42,6 @@
4342
import org.slf4j.LoggerFactory;
4443

4544
import java.lang.reflect.InvocationTargetException;
46-
import java.security.NoSuchAlgorithmException;
4745
import java.security.interfaces.ECPrivateKey;
4846
import java.security.interfaces.ECPublicKey;
4947
import java.time.Duration;
@@ -179,7 +177,7 @@ public Builder secret(String secret) {
179177
* @return the builder instance
180178
*/
181179
public Builder keyPair(String publicKey, String privateKey) {
182-
var keyLoader = new EcKeyLoader();
180+
var keyLoader = new ECKeyLoader();
183181
this.publicKey = keyLoader.loadPublicKey(publicKey);
184182
this.privateKey = keyLoader.loadPrivateKey(privateKey);
185183
return this;

0 commit comments

Comments
 (0)