- All Superinterfaces:
- All Known Subinterfaces:
- All Known Implementing Classes:
public interface SecretKey extends Key, DestroyableA secret (symmetric) key. The purpose of this interface is to group (and provide type safety for) all secret key interfaces.
Provider implementations of this interface must overwrite the
hashCodemethods inherited from
Object, so that secret keys are compared based on their underlying key material and not based on reference. Implementations should override the default
isDestroyedmethods from the
Destroyableinterface to enable sensitive key information to be destroyed, cleared, or in the case where such information is immutable, unreferenced. Finally, since
Serializable, implementations should also override
ObjectOutputStream.writeObject(java.lang.Object)to prevent keys that have been destroyed from being serialized.
Keys that implement this interface return the string
RAWas their encoding format (see
getFormat), and return the raw key bytes as the result of a
getEncodedmethod call. (The
getEncodedmethods are inherited from the
- See Also:
Fields Modifier and Type Field Description
serialVersionUIDThe class fingerprint that is set to indicate serialization compatibility since J2SE 1.4.
Methods declared in interface javax.security.auth.Destroyable
Methods declared in interface java.security.Key
getAlgorithm, getEncoded, getFormat
static final long serialVersionUIDThe class fingerprint that is set to indicate serialization compatibility since J2SE 1.4.
- See Also:
- Constant Field Values