Access Non-Global Key
To get an instance of a non-global key (a key that is not accessible to all users), you must pass the session object to the getSecretKey
method. The NAE Server then returns the key, provided that the key is accessible to the authenticated user.
Create an
NAESession
object.Obtain an instance of the key using the
getSecretKey
method of theNAEKey
class. Pass theNAESession
object as an argument.
Code sample
The following code sample returns a list of all global keys, all keys owned by user1, and all keys that are accessible to groups to which user1 belongs.
NAESession session = NAESession.getSession("user1" ,"password1".toCharArray());
NAESecretKey key = NAEKey.getSecretKey("user1key",session);