Package javax.crypto

Interface Summary

SecretKey A secret key for symmetric cryptography.

Class Summary

Cipher This class implements a cryptographic cipher for transforming data.

Ciphers cannot be instantiated directly; rather one of the getInstance must be used to instantiate a given transformation, optionally with a specific provider.

A transformation is of the form:

  • algorithm/mode/padding, or
  • algorithm

where algorithm is the base name of a cryptographic cipher (such as "AES"), mode is the abbreviated name of a block cipher mode (such as "CBC" for cipher block chaining mode), and padding is the name of a padding scheme (such as "PKCS5Padding").

CipherInputStream This is an InputStream that filters its data through a Cipher before returning it.
CipherOutputStream A filtered output stream that transforms data written to it with a Cipher before sending it to the underlying output stream.
CipherSpi This class represents the Service Provider Interface (SPI) for cryptographic ciphers.

Providers of cryptographic ciphers must subclass this for every cipher they implement, implementing the abstract methods as appropriate, then provide an entry that points to the subclass in their implementation of Provider.

CipherSpi objects are instantiated along with Ciphers when the Cipher.getInstance(String) methods are invoked.

EncryptedPrivateKeyInfo An implementation of the EncryptedPrivateKeyInfo ASN.1 type as specified in PKCS #8 - Private-Key Information Syntax Standard.
ExemptionMechanism An exemption mechanism, which will conditionally allow cryptography where it is not normally allowed, implements things such as key recovery, key weakening, or key escrow.
ExemptionMechanismSpi The Service Provider Interface (SPI) for the ExemptionMechanism class.
KeyAgreement Key agreement is a method in which two or more parties may agree on a secret key for symmetric cryptography or message authentication without transmitting any secrets in the clear.
KeyAgreementSpi This is the Service Provider Interface (SPI) for the KeyAgreement class.
KeyGenerator A generic producer of keys for symmetric cryptography.
KeyGeneratorSpi The Service Provider Interface (SPI) for the KeyGenerator class.
Mac This class implements a "message authentication code" (MAC), a method to ensure the integrity of data transmitted between two parties who share a common secret key.
MacSpi This is the Service Provider Interface (SPI) for the Mac class.
NullCipher Trivial subclass of Cipher that implements the identity transformation, where the input is always copied to the output unchanged.
SealedObject This class allows any Serializable object to be stored in an encrypted form.
SecretKeyFactory A secret key factory translates SecretKey objects to and from KeySpec objects, and can translate between different vendors' representations of SecretKey objects (for security or semantics; whichever applies).
SecretKeyFactorySpi The Service Provider Interface (SPI) for the SecretKeyFactory class.

Exception Summary

BadPaddingException This exception is thrown during decryption when the decrypted input does not have the proper padding bytes that are expected by the padding mechanism.
ExemptionMechanismException Signals a general exception in an ExemptionMechanism.
IllegalBlockSizeException This exception is thrown when finishing encryption without padding or decryption and the input is not a multiple of the cipher's block size.
NoSuchPaddingException This exception is thrown when a particular padding scheme is requested but is not available.
ShortBufferException This exception is thrown on an attempt to transform bytes into a buffer that is too short to contain the data.