RFR: 5066842: PKCS8EncodedKeySpec needs getAlgorithm method [v2]

Valerie Peng valeriep at openjdk.org
Thu Sep 1 23:50:50 UTC 2022


On Thu, 1 Sep 2022 23:45:31 GMT, Weijun Wang <weijun at openjdk.org> wrote:

>> Since the algorithm is already encoded inside a PKCS #8 data block, it is not necessary to provide an algorithm when a `PKCS8EncodedKeySpec` object is created. The same for `X509EncodedKeySpec`.
>
> Weijun Wang has updated the pull request incrementally with one additional commit since the last revision:
> 
>   fine tune spec

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.

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

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



More information about the security-dev mailing list