Create Versioned Key
Create an
NAEParameterSpec
object. To create a versioned key, the constructor needs the following parameters:name (String)
,exportable (boolean)
,deletable (boolean)
,versioned (boolean)
,length (int)
,attrs (CustomAttributes)
, andsession (NAESession)
.Obtain an instance of
KeyGenerator
. Pass the key algorithm and provider name (IngrianProvider
) as arguments.Initialize the cipher for encryption.
Call the
generateKey
method of theKeyGenerator
object to create the key.
Code sample
The following code sample generates a global AES key named mykey.
The first version of the key is automatically created.