RFR: 8298420: PEM API: Implementation (Preview) [v2]
Anthony Scarpino
ascarpino at openjdk.org
Tue Jul 30 19:02:33 UTC 2024
On Mon, 29 Jul 2024 16:06:07 GMT, Weijun Wang <weijun at openjdk.org> wrote:
>> I hadn't thought about an OID string value. The alternative to not using returning an OID is null. I don't see a problem returning an OID, as we have seen in other areas where `Key.getAlgorithm()` returns a non-crypto algorithm name. I understand what you are saying that we typically return a standard name, and that will still be true in a vast majority of the encodings. But I think returning the OID is a better choice in this corner case than returning null.
>
> The current spec says "or null if not specified", so it's actually OK if one is not specified -- if I understand correctly -- through the constructor that take an algorithm argument. You might actually need to update the spec with your code change.
I understand null is a valid value, but I'm more curious if you think null is a better option than an OID string? An OID is not ideal, and I suspect would be rare. The ones that come to mind that we are missing are SM*, which probably should be added at some point anyway.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/17543#discussion_r1697439858
More information about the security-dev
mailing list