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