RFR: 8002277: Refactor two PBE classes to simplify maintenance [v2]
Valerie Peng
valeriep at openjdk.java.net
Tue May 10 01:54:36 UTC 2022
On Mon, 9 May 2022 14:09:28 GMT, Weijun Wang <weijun at openjdk.org> wrote:
> It's a pity you have to implement all those `engineXyz` methods in all three `CipherSpi` implementations here. Is there something simpler?
I debated shifting all these "engineXyz" methods into the PKCS12PBECipherCore class and store the CipherSpi object inside PKCS12PBECipher class, but then whenever we need to call "Cipher.engineXyz" methods, we'd need to cast the CipherSpi object to the actual impl class. There are also additional logic for handling mode, padding in PKCS12PBECipherCore class if we go this route. Comparing to the current approach, there are different pros and cons. I prefer less casting.
-------------
PR: https://git.openjdk.java.net/jdk/pull/8521
More information about the security-dev
mailing list