RFR: 5066842: PKCS8EncodedKeySpec needs getAlgorithm method [v2]

Weijun Wang weijun at openjdk.org
Thu Sep 8 15:21:46 UTC 2022


On Fri, 2 Sep 2022 08:51:04 GMT, Bernd <duke at openjdk.org> wrote:

>> I want this to be spec from now on. If we want to backport this to older releases, then the paragraph above can be @implNote.
>
> I agree that this should be in the API spec.
> 
> Does the „return null“ case for invalid encodings need to mention any exceptions triggered by the actual key instantion to make clear the Spec is only a container?

I plan to swallow all exceptions while parsing the ASN.1 encoding and not mentioning any type name. Also, I only intend to read until the algorithm field, no key material is read and certainly no `Key` object is instantiated.

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

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



More information about the security-dev mailing list