# java.security.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 DSA public and private keys,
RSA public and private keys, PKCS #8 private keys in DER-encoded format,
and X.509 public and private keys in DER-encoded format.

An algorithm parameter specification is a transparent representation
of the sets of parameters used with an algorithm. This package contains
an algorithm parameter specification for parameters used with the
DSA algorithm.

## Package Specification

- PKCS #1: RSA Encryption Standard, Version 1.5, November 1993
- PKCS #8: Private-Key Information Syntax Standard, Version 1.2, November 1993
- Federal Information Processing Standards Publication (FIPS PUB) 186: Digital Signature Standard (DSS)

## Related Documentation

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

- [**Java™
  Cryptography Architecture API Specification and Reference**](https://developers.google.com/j2objc/javadoc/jre/technotes/guides/security/crypto/CryptoSpec.html)
- [**How to Implement a Provider for the
  Java™ Cryptography Architecture**](https://developers.google.com/j2objc/javadoc/jre/technotes/guides/security/crypto/HowToImplAProvider.html)

### Interfaces

|---|---|
| [AlgorithmParameterSpec](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/spec/AlgorithmParameterSpec.html) | A (transparent) specification of cryptographic parameters. |
| [ECField](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/spec/ECField.html) | This interface represents an elliptic curve (EC) finite field. |
| [KeySpec](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/spec/KeySpec.html) | A (transparent) specification of the key material that constitutes a cryptographic key. |

### Classes

|---|---|
| [DSAParameterSpec](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/spec/DSAParameterSpec.html) | This class specifies the set of parameters used with the DSA algorithm. |
| [DSAPrivateKeySpec](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/spec/DSAPrivateKeySpec.html) | This class specifies a DSA private key with its associated parameters. |
| [DSAPublicKeySpec](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/spec/DSAPublicKeySpec.html) | This class specifies a DSA public key with its associated parameters. |
| [ECFieldF2m](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/spec/ECFieldF2m.html) | This immutable class defines an elliptic curve (EC) characteristic 2 finite field. |
| [ECFieldFp](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/spec/ECFieldFp.html) | This immutable class defines an elliptic curve (EC) prime finite field. |
| [ECGenParameterSpec](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/spec/ECGenParameterSpec.html) | This immutable class specifies the set of parameters used for generating elliptic curve (EC) domain parameters. |
| [ECParameterSpec](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/spec/ECParameterSpec.html) | This immutable class specifies the set of domain parameters used with elliptic curve cryptography (ECC). |
| [ECPoint](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/spec/ECPoint.html) | This immutable class represents a point on an elliptic curve (EC) in affine coordinates. |
| [ECPrivateKeySpec](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/spec/ECPrivateKeySpec.html) | This immutable class specifies an elliptic curve private key with its associated parameters. |
| [ECPublicKeySpec](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/spec/ECPublicKeySpec.html) | This immutable class specifies an elliptic curve public key with its associated parameters. |
| [EllipticCurve](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/spec/EllipticCurve.html) | This immutable class holds the necessary values needed to represent an elliptic curve. |
| [EncodedKeySpec](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/spec/EncodedKeySpec.html) | This class represents a public or private key in encoded format. |
| [MGF1ParameterSpec](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/spec/MGF1ParameterSpec.html) | This class specifies the set of parameters used with mask generation function MGF1 in OAEP Padding and RSA-PSS signature scheme, as defined in the [PKCS #1 v2.1](http://www.ietf.org/rfc/rfc3447.txt) standard. |
| [PKCS8EncodedKeySpec](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/spec/PKCS8EncodedKeySpec.html) | This class represents the ASN.1 encoding of a private key, encoded according to the ASN.1 type `PrivateKeyInfo`. |
| [PSSParameterSpec](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/spec/PSSParameterSpec.html) | This class specifies a parameter spec for RSA-PSS signature scheme, as defined in the [PKCS#1 v2.1](http://www.ietf.org/rfc/rfc3447.txt) standard. |
| [RSAKeyGenParameterSpec](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/spec/RSAKeyGenParameterSpec.html) | This class specifies the set of parameters used to generate an RSA key pair. |
| [RSAMultiPrimePrivateCrtKeySpec](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/spec/RSAMultiPrimePrivateCrtKeySpec.html) | This class specifies an RSA multi-prime private key, as defined in the PKCS#1 v2.1, using the Chinese Remainder Theorem (CRT) information values for efficiency. |
| [RSAOtherPrimeInfo](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/spec/RSAOtherPrimeInfo.html) | This class represents the triplet (prime, exponent, and coefficient) inside RSA's OtherPrimeInfo structure, as defined in the PKCS#1 v2.1. |
| [RSAPrivateCrtKeySpec](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/spec/RSAPrivateCrtKeySpec.html) | This class specifies an RSA private key, as defined in the PKCS#1 standard, using the Chinese Remainder Theorem (CRT) information values for efficiency. |
| [RSAPrivateKeySpec](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/spec/RSAPrivateKeySpec.html) | This class specifies an RSA private key. |
| [RSAPublicKeySpec](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/spec/RSAPublicKeySpec.html) | This class specifies an RSA public key. |
| [X509EncodedKeySpec](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/spec/X509EncodedKeySpec.html) | This class represents the ASN.1 encoding of a public key, encoded according to the ASN.1 type `SubjectPublicKeyInfo`. |

### Exceptions

|---|---|
| [InvalidKeySpecException](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/spec/InvalidKeySpecException.html) | This is the exception for invalid key specifications. |
| [InvalidParameterSpecException](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/spec/InvalidParameterSpecException.html) | This is the exception for invalid parameter specifications. |