Cipher (Java SE 22 & JDK 22)
-
Field Summary
Fields
static final intConstant used to initialize cipher to decryption mode.
static final intConstant used to initialize cipher to encryption mode.
static final intConstant used to indicate the to-be-unwrapped key is a "private key".
static final intConstant used to indicate the to-be-unwrapped key is a "public key".
static final intConstant used to indicate the to-be-unwrapped key is a "secret key".
static final intConstant used to initialize cipher to key-unwrapping mode.
static final intConstant used to initialize cipher to key-wrapping mode.
-
Constructor Summary
Constructors
-
Method Summary
final byte[]doFinal()Finishes a multiple-part encryption or decryption operation, depending on how this
Cipherobject was initialized.final byte[]doFinal(byte[] input) Encrypts or decrypts data in a single-part operation, or finishes a multiple-part operation.
final intdoFinal(byte[] output, int outputOffset) Finishes a multiple-part encryption or decryption operation, depending on how this
Cipherobject was initialized.final byte[]doFinal(byte[] input, int inputOffset, int inputLen) Encrypts or decrypts data in a single-part operation, or finishes a multiple-part operation.
final intdoFinal(byte[] input, int inputOffset, int inputLen, byte[] output) Encrypts or decrypts data in a single-part operation, or finishes a multiple-part operation.
final intdoFinal(byte[] input, int inputOffset, int inputLen, byte[] output, int outputOffset) Encrypts or decrypts data in a single-part operation, or finishes a multiple-part operation.
final intEncrypts or decrypts data in a single-part operation, or finishes a multiple-part operation.
Returns the algorithm name of this
Cipherobject.final intReturns the block size (in bytes).
Returns the exemption mechanism object used with this
Cipherobject.Returns a
Cipherobject that implements the specified transformation.Returns a
Cipherobject that implements the specified transformation.Returns a
Cipherobject that implements the specified transformation.final byte[]getIV()Returns the initialization vector (IV) in a new buffer.
static final intReturns the maximum key length for the specified transformation according to the installed JCE jurisdiction policy files.
Returns an {code AlgorithmParameterSpec} object which contains the maximum
Cipherparameter value according to the jurisdiction policy file.final intgetOutputSize(int inputLen) Returns the length in bytes that an output buffer would need to be in order to hold the result of the next
updateordoFinaloperation, given the input lengthinputLen(in bytes).Returns the parameters used with this
Cipherobject.Returns the provider of this
Cipherobject.final voidInitializes this
Cipherobject with the public key from the given certificate.final voidInitializes this
Cipherobject with the public key from the given certificate and a source of randomness.final voidInitializes this
Cipherobject with a key.final voidInitializes this
Cipherobject with a key and a set of algorithm parameters.final voidInitializes this
Cipherobject with a key, a set of algorithm parameters, and a source of randomness.final voidInitializes this
Cipherobject with a key and a source of randomness.final voidInitializes this
Cipherobject with a key and a set of algorithm parameters.final voidInitializes this
Cipherobject with a key, a set of algorithm parameters, and a source of randomness.toString()Returns a
Stringrepresentation of thisCipherobject.unwrap(byte[] wrappedKey, String wrappedKeyAlgorithm, int wrappedKeyType) Unwrap a previously wrapped key.
final byte[]update(byte[] input) Continues a multiple-part encryption or decryption operation (depending on how this
Cipherobject was initialized), processing another data part.final byte[]update(byte[] input, int inputOffset, int inputLen) Continues a multiple-part encryption or decryption operation (depending on how this
Cipherobject was initialized), processing another data part.final intupdate(byte[] input, int inputOffset, int inputLen, byte[] output) Continues a multiple-part encryption or decryption operation (depending on how this
Cipherobject was initialized), processing another data part.final intupdate(byte[] input, int inputOffset, int inputLen, byte[] output, int outputOffset) Continues a multiple-part encryption or decryption operation (depending on how this
Cipherobject was initialized), processing another data part.final intContinues a multiple-part encryption or decryption operation (depending on how this
Cipherobject was initialized), processing another data part.final voidupdateAAD(byte[] src) Continues a multi-part update of the Additional Authentication Data (AAD).
final voidupdateAAD(byte[] src, int offset, int len) Continues a multi-part update of the Additional Authentication Data (AAD), using a subset of the provided buffer.
final voidContinues a multi-part update of the Additional Authentication Data (AAD).
final byte[]
-
Field Details
-
ENCRYPT_MODE
-
DECRYPT_MODE
-
WRAP_MODE
-
UNWRAP_MODE
-
PUBLIC_KEY
-
PRIVATE_KEY
-
SECRET_KEY
-
-
Constructor Details
-
Cipher
-
-
Method Details
-
getInstance
-
getInstance
-
getInstance
-
getProvider
-
getAlgorithm
-
getBlockSize
-
getOutputSize
-
getIV
-
getParameters
-
getExemptionMechanism
-
init
-
init
-
init
-
init
-
init
-
init
-
init
-
init
-
update
-
update
-
update
-
update
-
update
-
doFinal
-
doFinal
-
doFinal
-
doFinal
-
doFinal
-
doFinal
-
doFinal
-
wrap
-
unwrap
-
getMaxAllowedKeyLength
-
getMaxAllowedParameterSpec
-
updateAAD
-
updateAAD
-
updateAAD
-
toString
-