On Fri, 13 Mar 2026 16:11:47 GMT, Mikhail Yankelevich 
<[email protected]> wrote:

>> Adding new methods to `X509Certificate` to return `Instant` instead of 
>> `Date` as well as moving away from `Date` in internal packages wherever 
>> possible.
>> 
>> ---------
>> - [x] I confirm that I make this contribution in accordance with the 
>> [OpenJDK Interim AI Policy](https://openjdk.org/legal/ai).
>
> Mikhail Yankelevich has updated the pull request incrementally with one 
> additional commit since the last revision:
> 
>   minor doc change

src/java.base/share/classes/sun/security/util/DerOutputStream.java line 34:

> 32: import java.time.Instant;
> 33: import java.time.ZoneId;
> 34: import java.time.format.DateTimeFormatter;

Remove useless imports.

src/java.base/share/classes/sun/security/util/DerOutputStream.java line 491:

> 489:      * 1/1/1950 is the lowest date that RFC 2630 serializes to UTC time
> 490:      */
> 491:     private static final Instant utcLow = 
> Instant.ofEpochMilli(-631152000000L); // Dates before 1/1/1950

`Instant.ofEpochSeconds` is simpler.

src/java.base/share/classes/sun/security/util/DerOutputStream.java line 541:

> 539:      * and with seconds (even if seconds=0) as per RFC 5280.
> 540:      */
> 541:     public DerOutputStream putGeneralizedInstant(Instant d) {

is it worth using a new method name? Maybe `putGeneralizedTime` is still OK?

src/java.base/share/classes/sun/security/x509/CertificateValidity.java line 47:

> 45:      * YR_2050 date and time set to Jan01 00:00 2050 GMT
> 46:      */
> 47:     static final long YR_2050 = 2524608000000L;

Does it make sense to define YR_2050 as an `Instant`?

test/jdk/sun/security/pkcs/pkcs10/PKCS10AttributeReader.java line 39:

> 37: import java.util.Enumeration;
> 38: import java.util.HashMap;
> 39: import java.util.Date;

This is useless.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/30047#discussion_r3202024822
PR Review Comment: https://git.openjdk.org/jdk/pull/30047#discussion_r3202032110
PR Review Comment: https://git.openjdk.org/jdk/pull/30047#discussion_r3202037971
PR Review Comment: https://git.openjdk.org/jdk/pull/30047#discussion_r3202063448
PR Review Comment: https://git.openjdk.org/jdk/pull/30047#discussion_r3202099290

Reply via email to