1. /*
  2. * Copyright 2002 Sun Microsystems, Inc. All rights reserved.
  3. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  4. */
  5. package javax.security.auth;
  6. /**
  7. * Objects such as credentials may optionally implement this interface
  8. * to provide the capability to destroy its contents.
  9. *
  10. * @version 1.7, 01/11/00
  11. * @see javax.security.auth.Subject
  12. */
  13. public interface Destroyable {
  14. /**
  15. * Destroy this <code>Object</code>.
  16. *
  17. * <p> Sensitive information associated with this <code>Object</code>
  18. * is destroyed or cleared. Subsequent calls to certain methods
  19. * on this <code>Object</code> will result in an
  20. * <code>IllegalStateException</code> being thrown.
  21. *
  22. * <p>
  23. *
  24. * @exception DestroyFailedException if the destroy operation fails. <p>
  25. *
  26. * @exception SecurityException if the caller does not have permission
  27. * to destroy this <code>Object</code>.
  28. */
  29. void destroy() throws DestroyFailedException;
  30. /**
  31. * Determine if this <code>Object</code> has been destroyed.
  32. *
  33. * <p>
  34. *
  35. * @return true if this <code>Object</code> has been destroyed,
  36. * false otherwise.
  37. */
  38. boolean isDestroyed();
  39. }