Generate Global EC Public-Private Key Pair
The user can get the group permissions applicable on an existing key through API.
Create an
ECCParameterSpec
object. Pass the key name and CurveId as an argument.Obtain an instance of
KeyPairGenerator
. Pass the key type as an argument.Call the
genKeyPair
method of theKeyPairGenerator
class.
Code sample
The following code sample generates a global EC public-private key pair named ECCKeyTest.
ECCParameterSpec spec= new ECCParameterSpec("ECCKeyTest",
ECCParameterSpec.CurveId.brainpoolP384t1);
KeyPairGenerator gen= KeyPairGenerator.getInstance("EC", "IngrianProvider");
gen.initialize(spec);
KeyPair keypair =gen.generateKeyPair();