RFR: 8374808: Add new methods to KeyStore and KeyStoreSpi that return the creation date as an Instant instead of Date [v3]
Sean Mullan
mullan at openjdk.org
Fri Jan 16 20:47:09 UTC 2026
On Thu, 15 Jan 2026 11:29:05 GMT, Mikhail Yankelevich <myankelevich at openjdk.org> wrote:
>> Hi!
>>
>> This is my proposal to transfer `KeyStore` and `KeyStoreSpi` with internal implementations to use `Instance`s instead of `Date`s.
>> I would be very grateful for your comments and suggestions.
>>
>> Thanks!
>>
>> P.S. this is related to [JDK-8350953](https://bugs.openjdk.org/browse/JDK-8350953)
>
> Mikhail Yankelevich has updated the pull request incrementally with one additional commit since the last revision:
>
> documentation change and truncated instances to millis
src/java.base/share/classes/java/security/KeyStore.java line 1210:
> 1208: /**
> 1209: * Returns the creation {@code Instant} value
> 1210: * of the entry identified by the given alias.
I would probably rephrase this as "Returns the instant that the entry identified by the given alias was created."
I don't think you need to put instant in code font as other methods that return instants do not do that.
src/java.base/share/classes/java/security/KeyStore.java line 1215:
> 1213: *
> 1214: * @return the creation instant of this entry, or {@code null} if the given
> 1215: * alias does not exist
Suggest similar rewording as above, i.e. "the instant that the entry identified by the given alias was created, or {@code null} if the given alias does not exist"
src/java.base/share/classes/java/security/KeyStoreSpi.java line 133:
> 131: /**
> 132: * Returns the creation {@code Instant} value
> 133: * of the entry identified by the given alias.
Same comment on the wording as in `KeyStore.getCreationInstant`.
src/java.base/share/classes/java/security/KeyStoreSpi.java line 137:
> 135: * @implSpec
> 136: * The default implementation calls {@code engineGetCreationDate(alias)}
> 137: * and returns the output as an {@code Instant} value.
Suggest you add something like "Subclasses should override this method to directly return an instant."
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/29140#discussion_r2699898772
PR Review Comment: https://git.openjdk.org/jdk/pull/29140#discussion_r2699899247
PR Review Comment: https://git.openjdk.org/jdk/pull/29140#discussion_r2699914585
PR Review Comment: https://git.openjdk.org/jdk/pull/29140#discussion_r2699913353
More information about the security-dev
mailing list