RFR: 5066842: PKCS8EncodedKeySpec needs getAlgorithm method [v2]
Bernd
duke at openjdk.org
Fri Sep 2 09:15:41 UTC 2022
On Thu, 1 Sep 2022 23:55:03 GMT, Weijun Wang <weijun at openjdk.org> wrote:
>> src/java.base/share/classes/java/security/spec/PKCS8EncodedKeySpec.java line 75:
>>
>>> 73: * field is returned in its string format as a series of nonnegative
>>> 74: * integers separated by periods (For example, "1.3.14.7.2.1.1").
>>> 75: * If the encoded key cannot be parsed correctly, the algorithm is {@code null}.
>>
>> Should these be under @implNote? Same question for the X509EncodedKeySpec also.
>
> 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?
-------------
PR: https://git.openjdk.org/jdk/pull/10131
More information about the security-dev
mailing list