Name

Destroyable

Synopsis

Classes that encapsulate sensitive information, such as security credentials, may implement this interface to provide an API that allows the sensitive information to be destroyed or erased. The destroy( ) method erases or clears the sensitive information. It may throw a DestroyFailedException if the information cannot be erased for any reason. It may also throw a SecurityException if the caller does not have whatever permissions are required. Once destroy( ) has been called on an object, the isDestroyed( ) method returns true. Once an object has been destroyed, any other methods it defines may throw an IllegalStateException.

public interface Destroyable {
// Public Instance Methods
     void destroy( ) throws DestroyFailedException;  
     boolean isDestroyed( );  
}

Implementations

java.security.KeyStore.PasswordProtection, javax.security.auth.kerberos.KerberosKey, javax.security.auth.kerberos.KerberosTicket, javax.security.auth.x500.X500PrivateCredential

Get Java in a Nutshell, 5th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.