chore: removed lombok and upgraded copyright

This commit is contained in:
zihluwang
2025-01-25 19:53:04 +08:00
parent f771b1af19
commit 971037f160
48 changed files with 220 additions and 507 deletions
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2024-2024 OnixByte.
* Copyright (C) 2024-2025 OnixByte.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -18,7 +18,8 @@
package com.onixbyte.security;
import com.onixbyte.security.exception.KeyLoadingException;
import lombok.extern.slf4j.Slf4j;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.security.KeyFactory;
import java.security.NoSuchAlgorithmException;
@@ -38,8 +39,7 @@ import java.util.Base64;
* </p>
*
* <p><b>Example usage:</b></p>
* <pre>
* {@code
* <pre>{@code
* String pemPrivateKey = """
* -----BEGIN PRIVATE KEY-----
* ...
@@ -51,16 +51,16 @@ import java.util.Base64;
* ...
* -----END PUBLIC KEY-----""";
* ECPublicKey publicKey = KeyLoader.loadEcdsaPublicKey(pemPublicKey);
* }
* </pre>
* }</pre>
*
* @author zihluwang
* @version 1.6.0
* @since 1.6.0
*/
@Slf4j
public class KeyLoader {
private final static Logger log = LoggerFactory.getLogger(KeyLoader.class);
/**
* Private constructor prevents from being initialised.
*/
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2024-2024 OnixByte.
* Copyright (C) 2024-2025 OnixByte.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -18,25 +18,23 @@
package com.onixbyte.security.exception;
/**
* The {@code KeyLoadingException} class represents an exception that is thrown when there is an error
* loading cryptographic keys. This exception can be used to indicate various issues such as invalid key
* specifications, unsupported key algorithms, or other key loading errors.
* The {@code KeyLoadingException} class represents an exception that is thrown when there is an
* error loading cryptographic keys. This exception can be used to indicate various issues such as
* invalid key specifications, unsupported key algorithms, or other key loading errors.
* <p>
* This class extends {@link RuntimeException}, allowing it to be thrown without being declared in a method's
* {@code throws} clause.
* This class extends {@link RuntimeException}, allowing it to be thrown without being declared in
* a method's {@code throws} clause.
* </p>
*
* <p><b>Example usage:</b></p>
* <pre>
* {@code
* <pre>{@code
* try {
* ECPrivateKey privateKey = KeyLoader.loadEcdsaPrivateKey(pemPrivateKey);
* } catch (KeyLoadingException e) {
* // Handle the exception
* e.printStackTrace();
* }
* }
* </pre>
* }</pre>
*
* @author zihluwang
* @version 1.6.0