javacard.security
Interface Key

All Known Subinterfaces:
DESKey, DSAPrivateKey, DSAPublicKey, PrivateKey, PublicKey, RSAPrivateCrtKey, RSAPrivateKey, RSAPublicKey, SecretKey

public interface Key

The Key interface is the base interface for all keys.

See Also:
KeyBuilder

Method Summary
 void clearKey()
          Clears the key and sets its initialized state to false.
 short getSize()
          Returns the key size in number of bits.
 byte getType()
          Returns the key interface type.
 boolean isInitialized()
          Reports the initialized state of the key.
 

Method Detail

isInitialized

public boolean isInitialized()
Reports the initialized state of the key. Keys must be initialized before being used.

A Key object sets its initialized state to true only when all the associated set methods have been invoked at least once since the time the initialized state was set to false.

A newly created Key object sets its initialized state to false. Invocation of the clearKey() method sets the initialized state to false. A key with transient key data sets its initialized state to false on the associated clear events.

Returns:
true if the key has been initialized.

clearKey

public void clearKey()
Clears the key and sets its initialized state to false.


getType

public byte getType()
Returns the key interface type.

Returns:
the key interface type.

See Also:
KeyBuilder

getSize

public short getSize()
Returns the key size in number of bits.

Returns:
the key size in number of bits.


Java and all Java-based trademarks and logos are trademarks or registered trademarks of Sun Microsystems, Inc. in the United States and other countries.