Start with encryption
This commit is contained in:
parent
9df61e0cd3
commit
b6af1c9792
8 changed files with 413 additions and 79 deletions
|
|
@ -1,6 +1,6 @@
|
|||
package ai.nomyo;
|
||||
|
||||
import ai.nomyo.errors.SecurityError;
|
||||
import java.util.concurrent.ExecutionException;
|
||||
|
||||
/**
|
||||
* Entry point — loads RSA keys and validates key length.
|
||||
|
|
@ -10,17 +10,15 @@ public class Main {
|
|||
static void main() {
|
||||
SecureCompletionClient secureCompletionClient = new SecureCompletionClient();
|
||||
//secureCompletionClient.generateKeys(true, "client_keys", "pokemon");
|
||||
secureCompletionClient.loadKeys("client_keys/private_key.pem", "pokemon");
|
||||
//secureCompletionClient.loadKeys("client_keys/private_key.pem", "pokemon");
|
||||
|
||||
|
||||
try {
|
||||
secureCompletionClient.validateRsaKey(secureCompletionClient.getPrivateKey());
|
||||
} catch (SecurityError e) {
|
||||
System.out.println("RSA Key is too short!");
|
||||
return;
|
||||
System.out.println(secureCompletionClient.fetchServerPublicKey().get());
|
||||
} catch (InterruptedException | ExecutionException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
||||
System.out.println("RSA Key has correct length!");
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue