On Mon, 9 May 2022 14:09:28 GMT, Weijun Wang <wei...@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

Reply via email to