RFR: 8279254: PKCS9Attribute SigningTime always encoded in UTFTime [v2]

Jamil Nimeh jnimeh at openjdk.org
Thu Jun 22 23:03:05 UTC 2023


On Thu, 22 Jun 2023 21:21:14 GMT, Ben Perez <duke at openjdk.org> wrote:

>> Added single-argument `putTime` method to `DerOutputStream` that selects the correct encoding based on the `Date` value. Similarly, a `getTime` method was added to `DerValue` to automatically call the correct decoding function based on the date type specified by the `tag`. Furthermore, the `encode` method in `PKCS9Attribute` was changed to utilize the new `putTime` method.
>
> Ben Perez has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Replaced depreciated ctor in putTime. Added getTime method to DerInputStream

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

> 488:     public DerOutputStream putTime(Date d) {
> 489:         Date low = new Date(-631152000L); // Dates before 1/1/1950
> 490:         Date high = new Date(2524607999L); // Dates after 12/31/2049

These two values should be in milliseconds.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/14617#discussion_r1239107752



More information about the security-dev mailing list