I am currently creating keyPair using this method
private KeyPair getKeyPair() throws NoSuchAlgorithmException, NoSuchProviderException, InvalidAlgorithmParameterException { KeyPairGenerator keyGen = KeyPairGenerator.getInstance("ECDsA", "SC"); ECGenParameterSpec ecSpec = new ECGenParameterSpec("secp256k1"); keyGen.initialize(ecSpec, new SecureRandom()); return keyGen.generateKeyPair(); }
KeyPairGenerator has another method in which I can specify keySize, but I'm not sure how I will pass keySpecs?
public void initialize(int keysize, SecureRandom random)
ua741 source share