Package java.security
Interface Key
-
- All Superinterfaces:
Serializable
- All Known Subinterfaces:
DHPrivateKey,DHPublicKey,DSAPrivateKey,DSAPublicKey,ECPrivateKey,ECPrivateKey,ECPublicKey,ECPublicKey,PBEKey,PrivateKey,PublicKey,RSAMultiPrimePrivateCrtKey,RSAPrivateCrtKey,RSAPrivateKey,RSAPublicKey,SecretKey
- All Known Implementing Classes:
BCDHPrivateKey,BCDHPublicKey,BCDSAPrivateKey,BCDSAPublicKey,BCECPrivateKey,BCECPublicKey,BCPBEKey,BCRSAPrivateCrtKey,BCRSAPrivateKey,BCRSAPublicKey,JCEDHPrivateKey,JCEDHPublicKey,JCEECPrivateKey,JCEECPublicKey,JCERSAPrivateCrtKey,JCERSAPrivateKey,JCERSAPublicKey,JDKDSAPrivateKey,JDKDSAPublicKey,OpenSSLECPrivateKey,OpenSSLECPublicKey,OpenSSLRSAPrivateCrtKey,OpenSSLRSAPrivateKey,OpenSSLRSAPublicKey,SecretKeySpec,X509PublicKey,X509PublicKey
public interface Key extends Serializable
Keyis the common interface for all keys.- See Also:
PublicKey,PrivateKey
-
-
Field Summary
Fields Modifier and Type Field Description static longserialVersionUIDTheserialVersionUIDto be compatible with JDK1.1.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description StringgetAlgorithm()Returns the name of the algorithm of this key.byte[]getEncoded()Returns the encoded form of this key, ornullif encoding is not supported by this key.StringgetFormat()Returns the name of the format used to encode this key, ornullif it can not be encoded.
-
-
-
Field Detail
-
serialVersionUID
static final long serialVersionUID
TheserialVersionUIDto be compatible with JDK1.1.- See Also:
- Constant Field Values
-
-
Method Detail
-
getAlgorithm
String getAlgorithm()
Returns the name of the algorithm of this key. If the algorithm is unknown,nullis returned.- Returns:
- the name of the algorithm of this key or
nullif the algorithm is unknown.
-
getFormat
String getFormat()
Returns the name of the format used to encode this key, ornullif it can not be encoded.- Returns:
- the name of the format used to encode this key, or
nullif it can not be encoded.
-
getEncoded
byte[] getEncoded()
Returns the encoded form of this key, ornullif encoding is not supported by this key.- Returns:
- the encoded form of this key, or
nullif encoding is not supported by this key.
-
-