RFR: 8358451: SunJCE PBEKey impl should throw IllegalStateException when getEncoded() is called [v3]

Valerie Peng valeriep at openjdk.org
Fri Jun 27 23:11:53 UTC 2025


> Update the `PBEKey` class of the SunJCE provider which override the `javax.security.auth.Destroyable` interface to 
> 
> 1. throw `IllegalStateException` if `getEncoded()` is called after key is destroyed
> 2. serialization of such destroyed `PBEKey` object will lead to exception. 
>  
> Also update the `PBEKeyFactory` class of the SunJCE provider to check for destroyed keys and throw exceptions per the method javadoc.

Valerie Peng has updated the pull request incrementally with one additional commit since the last revision:

  Change "key" to "Key" in exception messages.

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/25632/files
  - new: https://git.openjdk.org/jdk/pull/25632/files/beb840be..d7335e3d

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=25632&range=02
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=25632&range=01-02

  Stats: 2 lines in 1 file changed: 0 ins; 0 del; 2 mod
  Patch: https://git.openjdk.org/jdk/pull/25632.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/25632/head:pull/25632

PR: https://git.openjdk.org/jdk/pull/25632


More information about the security-dev mailing list