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

Ben Perez duke at openjdk.org
Mon Oct 2 23:03:47 UTC 2023


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

> * Cipher.updateAAD(...) methods also calls checkCipherState(), so its javadoc should be updated as well?

The current documentation for Cipher.updateAAD(...) is:

"@throws IllegalStateException if this {@code Cipher} object is in a wrong state (e.g., has not been initialized), does not accept AAD, or if operating in either GCM or CCM mode and one of the {@code update} methods has already been called for the active encryption/decryption operation"

This seems fairly explicit, but I could change the wording to 

"@throws IllegalStateException if this {@code Cipher} object is in a wrong state (e.g., has not been initialized, or is not in ENCRYPT_MODE or DECRYPT_MODE)"

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

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



More information about the security-dev mailing list