Interface Key
-
- All Known Subinterfaces:
AESKey,DESKey,DHPrivateKey,DHPublicKey,DSAPrivateKey,DSAPublicKey,ECPrivateKey,ECPublicKey,GenericSecretKey,HMACKey,KoreanSEEDKey,PrivateKey,PublicKey,RSAPrivateCrtKey,RSAPrivateKey,RSAPublicKey,SecretKey,SM4Key,XECPrivateKey,XECPublicKey
public interface KeyTheKeyinterface is the base interface for all keys.A
Keyobject sets its initialized state to true only when all the associatedKeyobject parameters have been set at least once since the time the initialized state was set to false.A newly created
Keyobject sets its initialized state to false. Invocation of theclearKey()method sets the initialized state to false. A key with transient key data sets its initialized state to false on the associated clear events.- See Also:
KeyBuilder
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidclearKey()Clears the key and sets its initialized state to false.shortgetSize()Returns the key size in number of bits.bytegetType()Returns the key interface type.booleanisInitialized()Reports the initialized state of the key.
-
-
-
Method Detail
-
isInitialized
boolean isInitialized()
Reports the initialized state of the key. Keys must be initialized before being used.A
Keyobject sets its initialized state to true only when all the associatedKeyobject parameters have been set at least once since the time the initialized state was set to false.A newly created
Keyobject sets its initialized state to false. Invocation of theclearKey()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:
trueif the key has been initialized
-
clearKey
void clearKey()
Clears the key and sets its initialized state to false.
-
getType
byte getType()
Returns the key interface type.- Returns:
- the key interface type. Valid codes listed in
TYPE_*constants, for exampleTYPE_DES_TRANSIENT_RESET. - See Also:
KeyBuilder
-
getSize
short getSize()
Returns the key size in number of bits. The size returned represents the capacity of the key.- Returns:
- the key size in number of bits
-
-