01: /*
02: * @(#)Key.java 1.5 02/07/24 @(#)
03: *
04: * Copyright (c) 2000-2001 Sun Microsystems, Inc. All rights reserved.
05: * PROPRIETARY/CONFIDENTIAL
06: * Use is subject to license terms.
07: */
08:
09: package com.sun.portal.ksecurity;
10:
11: /**
12: * Implements an abstract class that represents all keys (both
13: * symmetric and asymmetric).
14: */
15: public abstract interface Key {
16: /** Clears the key and sets it to an uninitialized state. */
17: void clearKey();
18:
19: /**
20: * Returns the key size in number of bits.
21: * @return the key size in number of bits
22: */
23: short getSize();
24:
25: /**
26: * Returns the key type.
27: * @return the key type
28: */
29: byte getType();
30:
31: /**
32: * Returns true if and only if a key has been initialized. A key is not
33: * initialized until all associated set methods have been called at
34: * least once since the last time the key was in an uninitialized state.
35: * @return true if the key has been initialized, false otherwise
36: */
37: boolean isInitialized();
38:
39: /**
40: * Converts a key object to its human readable string representation.
41: * @return a human readable string representation of the key
42: */
43: String toString();
44: }
|