Added in API level 1

KeySpec

public interface KeySpec

java.security.spec.KeySpec
DESKeySpec This class specifies a DES key. 
DESedeKeySpec This class specifies a DES-EDE ("triple-DES") key. 
DHPrivateKeySpec This class specifies a Diffie-Hellman private key with its associated parameters. 
DHPublicKeySpec This class specifies a Diffie-Hellman public key with its associated parameters. 
DSAPrivateKeySpec This class specifies a DSA private key with its associated parameters. 
DSAPublicKeySpec This class specifies a DSA public key with its associated parameters. 
ECPrivateKeySpec This immutable class specifies an elliptic curve private key with its associated parameters. 
ECPublicKeySpec This immutable class specifies an elliptic curve public key with its associated parameters. 
EdECPrivateKeySpec A class representing elliptic curve private keys as defined in RFC 8032: Edwards-Curve Digital Signature Algorithm (EdDSA), including the curve and other algorithm parameters. 
EdECPublicKeySpec A class representing elliptic curve public keys as defined in RFC 8032: Edwards-Curve Digital Signature Algorithm (EdDSA), including the curve and other algorithm parameters. 
EncodedKeySpec This class represents a public or private key in encoded format. 
KeyInfo Information about a key from the Android Keystore system
PBEKeySpec A user-chosen password that can be used with password-based encryption (PBE). 
PKCS8EncodedKeySpec This class represents the ASN.1 encoding of a private key, encoded according to the ASN.1 type PrivateKeyInfo
RSAMultiPrimePrivateCrtKeySpec This class specifies an RSA multi-prime private key, as defined in the PKCS#1 v2.2 standard using the Chinese Remainder Theorem (CRT) information values for efficiency. 
RSAPrivateCrtKeySpec This class specifies an RSA private key, as defined in the PKCS#1 v2.2 standard, using the Chinese Remainder Theorem (CRT) information values for efficiency. 
RSAPrivateKeySpec This class specifies an RSA private key. 
RSAPublicKeySpec This class specifies an RSA public key. 
SecretKeySpec This class specifies a secret key in a provider-independent fashion. 
X509EncodedKeySpec This class represents the ASN.1 encoding of a public key, encoded according to the ASN.1 type SubjectPublicKeyInfo
XECPrivateKeySpec A class representing elliptic curve private keys as defined in RFC 7748, including the curve and other algorithm parameters. 
XECPublicKeySpec A class representing elliptic curve public keys as defined in RFC 7748, including the curve and other algorithm parameters. 
XdhKeySpec External Diffie\u2013Hellman (XDH) key spec holding either a public or private key. 


A (transparent) specification of the key material that constitutes a cryptographic key.

If the key is stored on a hardware device, its specification may contain information that helps identify the key on the device.

A key may be specified in an algorithm-specific way, or in an algorithm-independent encoding format (such as ASN.1). For example, a DSA private key may be specified by its components x, p, q, and g (see DSAPrivateKeySpec), or it may be specified using its DER encoding (see PKCS8EncodedKeySpec).

This interface contains no methods or constants. Its only purpose is to group (and provide type safety for) all key specifications. All key specifications must implement this interface.

Analyze and address issues from Firebase Crashlytics and Android Vitals with the App Quality Insights tool window in Android Studio.

Updated Apr 30, 2024

Discover the latest app development tools, platform updates, training, and documentation for developers across every Android device.

Updated Dec 20, 2024