# javax.crypto.spec

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

# javax.crypto.spec

Provides classes and interfaces for key specifications and algorithm parameter specifications.

A key specification is a transparent representation of the key material that constitutes a key. A key may be specified in an algorithm-specific way, or in an algorithm-independent encoding format (such as ASN.1). This package contains key specifications for Diffie-Hellman public and private keys, as well as key specifications for DES, Triple DES, and PBE secret keys.

An algorithm parameter specification is a transparent representation of the sets of parameters used with an algorithm. This package contains algorithm parameter specifications for parameters used with the Diffie-Hellman, DES, Triple DES, PBE, RC2 and RC5 algorithms.

## Package Specification

- PKCS #3: Diffie-Hellman Key-Agreement Standard, Version 1.4, November 1993.
- PKCS #5: Password-Based Encryption Standard, Version 1.5, November 1993.
- Federal Information Processing Standards Publication (FIPS PUB) 46-2: Data Encryption Standard (DES)

## Related Documentation

For documentation that includes information about algorithm parameter and key specifications, please see:

- [**Java^TM^Cryptography Architecture API Specification and Reference**](https://../technotes/guides/security/crypto/CryptoSpec.html)
- [**How to Implement a Provider for the Java^TM^Cryptography Architecture**](https://../technotes/guides/security/crypto/HowToImplAProvider.html)

## Classes

|----------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [ChaCha20ParameterSpec](https://developer.android.com/reference/javax/crypto/spec/ChaCha20ParameterSpec) | This class specifies the parameters used with the[*ChaCha20*](https://tools.ietf.org/html/rfc7539)algorithm.                                                   |
| [DESedeKeySpec](https://developer.android.com/reference/javax/crypto/spec/DESedeKeySpec)                 | This class specifies a DES-EDE ("triple-DES") key.                                                                                                             |
| [DESKeySpec](https://developer.android.com/reference/javax/crypto/spec/DESKeySpec)                       | This class specifies a DES key.                                                                                                                                |
| [DHGenParameterSpec](https://developer.android.com/reference/javax/crypto/spec/DHGenParameterSpec)       | This class specifies the set of parameters used for generating Diffie-Hellman (system) parameters for use in Diffie-Hellman key agreement.                     |
| [DHParameterSpec](https://developer.android.com/reference/javax/crypto/spec/DHParameterSpec)             | This class specifies the set of parameters used with the Diffie-Hellman algorithm, as specified in PKCS #3:*Diffie-Hellman Key-Agreement Standard*.            |
| [DHPrivateKeySpec](https://developer.android.com/reference/javax/crypto/spec/DHPrivateKeySpec)           | This class specifies a Diffie-Hellman private key with its associated parameters.                                                                              |
| [DHPublicKeySpec](https://developer.android.com/reference/javax/crypto/spec/DHPublicKeySpec)             | This class specifies a Diffie-Hellman public key with its associated parameters.                                                                               |
| [GCMParameterSpec](https://developer.android.com/reference/javax/crypto/spec/GCMParameterSpec)           | Specifies the set of parameters required by a[Cipher](https://developer.android.com/reference/javax/crypto/Cipher)using the Galois/Counter Mode (GCM) mode.    |
| [IvParameterSpec](https://developer.android.com/reference/javax/crypto/spec/IvParameterSpec)             | This class specifies an*initialization vector*(IV).                                                                                                            |
| [OAEPParameterSpec](https://developer.android.com/reference/javax/crypto/spec/OAEPParameterSpec)         | This class specifies the set of parameters used with OAEP Padding, as defined in the[PKCS #1](http://www.ietf.org/rfc/rfc3447.txt)standard.                    |
| [PBEKeySpec](https://developer.android.com/reference/javax/crypto/spec/PBEKeySpec)                       | A user-chosen password that can be used with password-based encryption (*PBE*).                                                                                |
| [PBEParameterSpec](https://developer.android.com/reference/javax/crypto/spec/PBEParameterSpec)           | This class specifies the set of parameters used with password-based encryption (PBE), as defined in the[PKCS #5](http://www.ietf.org/rfc/rfc2898.txt)standard. |
| [PSource](https://developer.android.com/reference/javax/crypto/spec/PSource)                             | This class specifies the source for encoding input P in OAEP Padding, as defined in the[PKCS #1](http://www.ietf.org/rfc/rfc3447.txt)standard.                 |
| [PSource.PSpecified](https://developer.android.com/reference/javax/crypto/spec/PSource.PSpecified)       | This class is used to explicitly specify the value for encoding input P in OAEP Padding.                                                                       |
| [RC2ParameterSpec](https://developer.android.com/reference/javax/crypto/spec/RC2ParameterSpec)           | This class specifies the parameters used with the[*RC2*](http://www.ietf.org/rfc/rfc2268.txt)algorithm.                                                        |
| [RC5ParameterSpec](https://developer.android.com/reference/javax/crypto/spec/RC5ParameterSpec)           | This class specifies the parameters used with the[*RC5*](http://www.ietf.org/rfc/rfc2040.txt)algorithm.                                                        |
| [SecretKeySpec](https://developer.android.com/reference/javax/crypto/spec/SecretKeySpec)                 | This class specifies a secret key in a provider-independent fashion.                                                                                           |

-

  ## Classes

  - [ChaCha20ParameterSpec](https://developer.android.com/reference/javax/crypto/spec/ChaCha20ParameterSpec)
  - [DESedeKeySpec](https://developer.android.com/reference/javax/crypto/spec/DESedeKeySpec)
  - [DESKeySpec](https://developer.android.com/reference/javax/crypto/spec/DESKeySpec)
  - [DHGenParameterSpec](https://developer.android.com/reference/javax/crypto/spec/DHGenParameterSpec)
  - [DHParameterSpec](https://developer.android.com/reference/javax/crypto/spec/DHParameterSpec)
  - [DHPrivateKeySpec](https://developer.android.com/reference/javax/crypto/spec/DHPrivateKeySpec)
  - [DHPublicKeySpec](https://developer.android.com/reference/javax/crypto/spec/DHPublicKeySpec)
  - [GCMParameterSpec](https://developer.android.com/reference/javax/crypto/spec/GCMParameterSpec)
  - [IvParameterSpec](https://developer.android.com/reference/javax/crypto/spec/IvParameterSpec)
  - [OAEPParameterSpec](https://developer.android.com/reference/javax/crypto/spec/OAEPParameterSpec)
  - [PBEKeySpec](https://developer.android.com/reference/javax/crypto/spec/PBEKeySpec)
  - [PBEParameterSpec](https://developer.android.com/reference/javax/crypto/spec/PBEParameterSpec)
  - [PSource](https://developer.android.com/reference/javax/crypto/spec/PSource)
  - [PSource.PSpecified](https://developer.android.com/reference/javax/crypto/spec/PSource.PSpecified)
  - [RC2ParameterSpec](https://developer.android.com/reference/javax/crypto/spec/RC2ParameterSpec)
  - [RC5ParameterSpec](https://developer.android.com/reference/javax/crypto/spec/RC5ParameterSpec)
  - [SecretKeySpec](https://developer.android.com/reference/javax/crypto/spec/SecretKeySpec)