2026-04-21 17:24:11 +02:00
|
|
|
package ai.nomyo;
|
|
|
|
|
|
|
|
|
|
import ai.nomyo.errors.SecurityError;
|
|
|
|
|
|
|
|
|
|
/**
|
2026-04-23 13:36:46 +02:00
|
|
|
* Entry point — loads RSA keys and validates key length.
|
2026-04-21 17:24:11 +02:00
|
|
|
*/
|
|
|
|
|
public class Main {
|
|
|
|
|
|
|
|
|
|
static void main() {
|
|
|
|
|
SecureCompletionClient secureCompletionClient = new SecureCompletionClient();
|
|
|
|
|
//secureCompletionClient.generateKeys(true, "client_keys", "pokemon");
|
|
|
|
|
secureCompletionClient.loadKeys("client_keys/private_key.pem", "pokemon");
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
secureCompletionClient.validateRsaKey(secureCompletionClient.getPrivateKey());
|
|
|
|
|
} catch (SecurityError e) {
|
2026-04-23 13:36:46 +02:00
|
|
|
System.out.println("RSA Key is too short!");
|
2026-04-21 17:24:11 +02:00
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
System.out.println("RSA Key has correct length!");
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|