org.netbeans.modules.keyring 1.1.2

org.netbeans.spi.keyring
Interface KeyringProvider


public interface KeyringProvider

Provider for a keyring. Should be registered in global lookup. Providers will be searched in the order in which they are encountered until one which is enabled() is found. There is a default platform-independent implementation at position 1000 which should always be enabled.

All SPI calls are made from one thread at a time, so providers need not be synchronized.


Method Summary
 void delete(String key)
          Delete a key from the ring.
 boolean enabled()
          Check whether this provider can be used in the current JVM session.
 char[] read(String key)
          Read a key from the ring.
 void save(String key, char[] password, String description)
          Save a key to the ring.
 

Method Detail

enabled

boolean enabled()
Check whether this provider can be used in the current JVM session. If integrating a native keyring, this should attempt to load related libraries and check whether they can be found. This method will be called at most once per JVM session, prior to any other methods in this interface being called.

Returns:
true if this provider should be used, false if not

read

char[] read(String key)
Read a key from the ring.

Parameters:
key - the identifier of the key
Returns:
its value if found (elements may be later nulled out), else null if not present

save

void save(String key,
          char[] password,
          String description)
Save a key to the ring. If it could not be saved, do nothing. If the key already existed, overwrite the password.

Parameters:
key - a key identifier
password - the password or other sensitive information associated with the key (elements will be later nulled out)
description - a user-visible description of the key (may be null)

delete

void delete(String key)
Delete a key from the ring. If the key was not in the ring to begin with, do nothing.

Parameters:
key - a key identifier

org.netbeans.modules.keyring 1.1.2

Built on September 19 2011.  |  Portions Copyright 1997-2011 Sun Microsystems, Inc. All rights reserved.