Destroyable (Java SE 15 & JDK 15) (original) (raw)
All Known Subinterfaces:
[DHPrivateKey](../../crypto/interfaces/DHPrivateKey.html "interface in javax.crypto.interfaces")
, [DSAPrivateKey](../../../java/security/interfaces/DSAPrivateKey.html "interface in java.security.interfaces")
, [ECPrivateKey](../../../java/security/interfaces/ECPrivateKey.html "interface in java.security.interfaces")
, [EdECPrivateKey](../../../java/security/interfaces/EdECPrivateKey.html "interface in java.security.interfaces")
, [PBEKey](../../crypto/interfaces/PBEKey.html "interface in javax.crypto.interfaces")
, [PrivateKey](../../../java/security/PrivateKey.html "interface in java.security")
, [RSAMultiPrimePrivateCrtKey](../../../java/security/interfaces/RSAMultiPrimePrivateCrtKey.html "interface in java.security.interfaces")
, [RSAPrivateCrtKey](../../../java/security/interfaces/RSAPrivateCrtKey.html "interface in java.security.interfaces")
, [RSAPrivateKey](../../../java/security/interfaces/RSAPrivateKey.html "interface in java.security.interfaces")
, [SecretKey](../../crypto/SecretKey.html "interface in javax.crypto")
, [XECPrivateKey](../../../java/security/interfaces/XECPrivateKey.html "interface in java.security.interfaces")
All Known Implementing Classes:
[EncryptionKey](../../../../java.security.jgss/javax/security/auth/kerberos/EncryptionKey.html "class in javax.security.auth.kerberos")
, [KerberosCredMessage](../../../../java.security.jgss/javax/security/auth/kerberos/KerberosCredMessage.html "class in javax.security.auth.kerberos")
, [KerberosKey](../../../../java.security.jgss/javax/security/auth/kerberos/KerberosKey.html "class in javax.security.auth.kerberos")
, [KerberosTicket](../../../../java.security.jgss/javax/security/auth/kerberos/KerberosTicket.html "class in javax.security.auth.kerberos")
, [KeyStore.PasswordProtection](../../../java/security/KeyStore.PasswordProtection.html "class in java.security")
, [SecretKeySpec](../../crypto/spec/SecretKeySpec.html "class in javax.crypto.spec")
, [X500PrivateCredential](x500/X500PrivateCredential.html "class in javax.security.auth.x500")
public interface Destroyable
Objects such as credentials may optionally implement this interface to provide the capability to destroy its contents.
Since:
1.4
See Also:
Method Summary
Modifier and Type | Method | Description |
---|---|---|
default void | destroy() | Destroy this Object. |
default boolean | isDestroyed() | Determine if this Object has been destroyed. |
Method Details
destroy
Destroy this
Object
.
Sensitive information associated with thisObject
is destroyed or cleared. Subsequent calls to certain methods on thisObject
will result in anIllegalStateException
being thrown.
Implementation Requirements:
The default implementation throwsDestroyFailedException
.
Throws:
[DestroyFailedException](DestroyFailedException.html "class in javax.security.auth")
- if the destroy operation fails.
[SecurityException](../../../java/lang/SecurityException.html "class in java.lang")
- if the caller does not have permission to destroy thisObject
.isDestroyed
default boolean isDestroyed()
Determine if thisObject
has been destroyed.
Implementation Requirements:
The default implementation returns false.
Returns:
true if thisObject
has been destroyed, false otherwise.