Package javax.crypto
This package provides the classes and interfaces for cryptographic applications implementing algorithms for encryption, decryption, or key agreement.
Stream ciphers are supported as well as asymmetric, symmetric and block ciphers. Cipher implementations from different providers can be integrated using
the SPI (Service Provider Interface) abstract classes. With class SealedObject a programmer can secure an object by
encrypting it with a cipher.
Authentication may be based on MAC (Message Authentication Code) such as HMAC (Hash MAC, i.e. with a SHA-1 hash function).
-
Interface Summary Interface Description SecretKey A cryptographic secret (symmetric) key. -
Class Summary Class Description Cipher This class provides access to implementations of cryptographic ciphers for encryption and decryption.CipherInputStream This class wraps anInputStreamand a cipher so thatread()methods return data that are read from the underlyingInputStreamand processed by the cipher.CipherOutputStream This class wraps an output stream and a cipher so thatwritemethods send the data through the cipher before writing them to the underlying output stream.CipherSpi This class defines the Service Provider Interface (SPI) for cryptographic ciphers.EncryptedPrivateKeyInfo This class implements theEncryptedPrivateKeyInfoASN.1 type as specified in PKCS #8 - Private-Key Information Syntax Standard.ExemptionMechanism This class implements the functionality of an exemption mechanism such as key recovery, key weakening, or key escrow.ExemptionMechanismSpi The Service Provider Interface (SPI) definition for theExemptionMechanismclass.KeyAgreement This class provides the functionality for a key exchange protocol.KeyAgreementSpi The Service Provider Interface (SPI) definition for theKeyAgreementclass.KeyGenerator This class provides the public API for generating symmetric cryptographic keys.KeyGeneratorSpi The Service Provider Interface (SPI) definition for theKeyGeneratorclass.Mac This class provides the public API for Message Authentication Code (MAC) algorithms.MacSpi The Service-Provider Interface (SPI) definition for theMacclass.NullCipher This class provides an identity cipher that does not transform the input data in any way.SealedObject ASealedObjectis a wrapper around aserializableobject instance and encrypts it using a cryptographic cipher.SecretKeyFactory The public API forSecretKeyFactoryimplementations.SecretKeyFactorySpi The Service Provider Interface (SPI) definition for theSecretKeyFactoryclass. -
Exception Summary Exception Description AEADBadTagException Thrown by aCipherthat is using an Authenticated Encryption with Additional Data (AEAD) mode such as Galois/Counter Mode (GCM) and the tag failed verification.BadPaddingException The exception that is thrown when a padding mechanism is expected for the input data, but the input data does not have the proper padding bytes.ExemptionMechanismException This is the base class forExemptionMechanismException.IllegalBlockSizeException The exception, that is thrown when the data length provided to a block cipher does not match the block size of the cipher.NoSuchPaddingException The exception that is thrown when the requested padding mechanism is not supported.ShortBufferException The exception that is thrown when the result of an operation is attempted to store in a user provided buffer that is too small.