This commit is contained in:
2026-03-10 16:43:36 +01:00
commit e866f771a1
17 changed files with 497 additions and 0 deletions
@@ -0,0 +1,13 @@
package dev.ksan.CASystem;
import java.security.KeyPair;
import java.security.KeyPairGenerator;
public class KeyService {
public static KeyPair generateRSAKeyPair() throws Exception {
KeyPairGenerator generator = KeyPairGenerator.getInstance("RSA");
generator.initialize(2048);
return generator.generateKeyPair();
}
}
@@ -0,0 +1,4 @@
package dev.ksan.CASystem;
public class RootCA {
}
+24
View File
@@ -0,0 +1,24 @@
package dev.ksan;
import dev.ksan.CASystem.KeyService;
import org.bouncycastle.jce.provider.BouncyCastleProvider;
import java.security.KeyPair;
import java.security.Security;
public class Main {
static void main() throws Exception {
Security.addProvider(new BouncyCastleProvider());
System.out.println("added bouncycastle provider");
KeyPair key =KeyService.generateRSAKeyPair();
System.out.println(key.getPrivate());
System.out.println(key.getPublic());
int maxKeySize = javax.crypto.Cipher.getMaxAllowedKeyLength("AES");
System.out.println("Max Key Size for AES : " + maxKeySize);
}
}
@@ -0,0 +1,7 @@
package dev.ksan.Users;
import java.util.UUID;
public class Organizer extends User {
UUID id ;
}
+9
View File
@@ -0,0 +1,9 @@
package dev.ksan.Users;
public class User {
private String username;
private String password;
//keypair i digitalni cert (da li za sve korisnike il samo za glasaca??? kontam da bi trebalo za sve)
}
+5
View File
@@ -0,0 +1,5 @@
package dev.ksan.Users;
public class Voter extends User {
String name;
}