src/main/Wallet.java
public void generateKeyPair() {
		try {
            KeyPairGenerator keyGen = KeyPairGenerator.getInstance("EC");
            
			// Initialize the key generator and generate a KeyPair
			keyGen.initialize(new ECGenParameterSpec("secp256r1"), new SecureRandom());
            KeyPair keyPair = keyGen.generateKeyPair();
            
            // Set the public and private keys from the keyPair
            privateKey = keyPair.getPrivate();
            publicKey = keyPair.getPublic();
		}catch(Exception e) {
			throw new RuntimeException(e);
		}
	}
// Generates a public and private key pair for this wallets addresses
Generates a public and private key pair for this wallets addresses
Generates a public and private key pair for this wallets addresses
public void generateKeyPair() {
		try {
            KeyPairGenerator keyGen = KeyPairGenerator.getInstance("EC");
			keyGen.initialize(new ECGenParameterSpec("secp256r1"), new SecureRandom());
            KeyPair keyPair = keyGen.generateKeyPair();
            privateKey = keyPair.getPrivate();
            publicKey = keyPair.getPublic();
		}catch(Exception e) {
			throw new RuntimeException(e);
		}
	}
public void generateKeyPair ( ) { try { KeyPairGenerator keyGen = KeyPairGenerator . getInstance ( "EC" ) ; keyGen . initialize ( new ECGenParameterSpec ( "secp256r1" ) , new SecureRandom ( ) ) ; KeyPair keyPair = keyGen . generateKeyPair ( ) ; privateKey = keyPair . getPrivate ( ) ; publicKey = keyPair . getPublic ( ) ; } catch ( Exception e ) { throw new RuntimeException ( e ) ; } }
Generates a public and private key pair for this wallets addresses
Generates a public and private key pair for this wallets addresses
// Initialize the key generator and generate a KeyPair // Set the public and private keys from the keyPair