> This PR is for clarifying the `NoSuchAlgorithmException` and 
> `NoSuchPaddingException` for the `Cipher.getInstance(String transformation, 
> Provider provider)` and `Cipher.getInstance(String transformation, String 
> provider)` methods.
> 
> As stated in `javax.crypto.CipherSpi` class, provider has the flexibility to 
> register their implementations through various sub-transformations. As a 
> result, depending on how the providers register the implementation, it may 
> lead to `NoSuchAlgorithmException` or `NoSuchPaddingException`. For example, 
> the provider A registers to support "AES/CBC/PKCS5Padding" vs provider B 
> registers to support "AES" (but would only accept "CBC" and "PKCS5Padding" as 
> the valid input for setting mode and padding). Calling 
> `Cipher.getInstance(...)` with "AES/CBC/NoPadding" against provider A and B 
> would lead to `NoSuchAlgorithmException` and `NoSuchPaddingException`. This 
> javadoc update hope to make it clear.
> 
> Thanks in advance for the review~
> Valerie

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

  Revised the wording again to avoid referring to NoSuchPaddingException
  in NoSuchAlgorithmException

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/26489/files
  - new: https://git.openjdk.org/jdk/pull/26489/files/92ae5bce..6f19aed0

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

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

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

Reply via email to