Class Key

java.lang.Object
com.aoapps.security.Key
All Implemented Interfaces:
AutoCloseable, Cloneable, Destroyable
Direct Known Subclasses:
UnprotectedKey

public class Key extends Object implements Destroyable, AutoCloseable, Cloneable
Represents plaintext random keys, with support for wiping the contents. This is used in preference to byte[] as a matter of both convenience and protection.

This does not provide any access to the given key. It is a key black hole: gone forever from outside observers. The only way a key is available is through a newly generated key.

Instances of this class are thread-safe.

This class intentionally does not implement equals(java.lang.Object) and hashCode(), as it is not intended to be used in data structures or any complex manipulation. It is solely meant to safely carry a key.

This class also does not implement Serializable or Externalizable. Applications that need to send keys across the wire must use another mechanism. Applications that need to store keys should be using HashedKey.

Author:
AO Industries, Inc.