init
This commit is contained in:
@@ -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 {
|
||||
}
|
||||
@@ -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 ;
|
||||
}
|
||||
@@ -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)
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
package dev.ksan.Users;
|
||||
|
||||
public class Voter extends User {
|
||||
String name;
|
||||
}
|
||||
Reference in New Issue
Block a user