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
NAESessionobject.Obtain an instance of the key using the
getSecretKeymethod of theNAEKeyclass. Pass theNAESessionobject 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);