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,DSAPrivateKeyImpl,DSAPublicKeyImpl,JCEDHPrivateKey,JCEDHPublicKey,JCEECPrivateKey,JCEECPublicKey,JCERSAPrivateCrtKey,JCERSAPrivateKey,JCERSAPublicKey,JDKDSAPrivateKey,JDKDSAPublicKey,OpenSSLDSAPrivateKey,OpenSSLDSAPublicKey,OpenSSLECPrivateKey,OpenSSLECPublicKey,OpenSSLRSAPrivateCrtKey,OpenSSLRSAPrivateKey,OpenSSLRSAPublicKey,OpenSSLSecretKey,PrivateKeyImpl,PublicKeyImpl,RepeatedSecretKeySpec,SecretKeySpec,X509PublicKey,X509PublicKey
public interface Key extends Serializable
Key is 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
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 Details
-
serialVersionUID
static final long serialVersionUIDTheserialVersionUIDto be compatible with JDK1.1.- See Also:
- Constant Field Values
-
-
Method Details
-
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.
-