Generate Global RSA Public-Private Key Pair
The user can get the group permissions applicable on an existing key through API.
Create an
NAEParameterSpec
object. Pass the key name 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 RSA public-private key pair named rsakey.
NAEParameterSpec spec = new NAEParameterSpec("rsakey");
KeyPairGenerator keygen = KeyPairGenerator.getInstance("RSA", "IngrianProvider");
keygen.initialize(spec);
KeyPair keypair = keygen.generateKeyPair();