RFR: 4964430: (spec) missing IllegalStateException exception requirement for javax.crypto.Cipher.doFinal [v2]

Ben Perez duke at openjdk.org
Tue Oct 3 16:32:49 UTC 2023


On Mon, 25 Sep 2023 23:48:49 GMT, Valerie Peng <valeriep at openjdk.org> wrote:

> * Given the current checkCipherState() impl does not check for states for NullCipher objects, do we want to also update the javax.crypto.NullCipher class javadoc to mention that IllegalStateException is not thrown by various methods?

Current documentation is:

"The {@code NullCipher} class is a class that provides an "identity cipher" -- one that does not transform the plain text.  As a consequence, the ciphertext is identical to the plaintext.  All initialization methods do nothing, while the blocksize is set to 1 byte."

Would it be sufficient for me to add "Unlike other ciphers, the {@code NullCipher} will not throw an {@code IllegalStateException} when in an incorrect state."

-------------

PR Comment: https://git.openjdk.org/jdk/pull/15727#issuecomment-1745321824



More information about the security-dev mailing list