8374808: Add new methods to KeyStore and KeyStoreSpi that return the creation date as an Instant instead of Date#29140
8374808: Add new methods to KeyStore and KeyStoreSpi that return the creation date as an Instant instead of Date#29140myankelev wants to merge 15 commits intoopenjdk:masterfrom
Conversation
|
👋 Welcome back myankelevich! A progress list of the required criteria for merging this PR into |
|
@myankelev This change now passes all automated pre-integration checks. ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details. After integration, the commit message for the final commit will be: You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been 446 new commits pushed to the
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details. ➡️ To integrate this PR with the above commit message to the |
|
@myankelev The following label will be automatically applied to this pull request:
When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command. |
wangweij
left a comment
There was a problem hiding this comment.
Mostly looks good. Do you have a plan to update the callers of KeyStore::getCreationDate?
Also, I see you skipped the SunPKCS11 and MSCAPI implementations. Are they too trivial and the default implementation is enough?
Apologies, missed this comment the last time I went through them. |
Webrevs
|
|
Can you change the title of the issue to be more descriptive that these are new APIs, ex: "Add new methods to KeyStore and KeyStoreSpi that return the creation date as an Instant instead of Date" |
wangweij
left a comment
There was a problem hiding this comment.
Some comments.
I have a small concern on the Instant.now() calls everywhere. As you can see in your TestKeyStoreBasic.java test, the value is truncated when persisting inside a keystore and when loaded again it's not identical to the old value. Will this create any interop issue in the real world? If we know a keystore implementation only support the precision of milliseconds, should we truncate it early?
I believe this would be the safest thing to do. Existing implementation is relying on I have changed these 'Instant.now()' to |
| dos.writeLong(((TrustedCertEntry)entry).date.getTime()); | ||
| dos.writeLong( | ||
| ((TrustedCertEntry)entry).date.toEpochMilli() | ||
| ); |
There was a problem hiding this comment.
Not very common to write ); on a new line.
Same below on line 659. Also in JavaKeyStore line 633.
There was a problem hiding this comment.
I'd personally prefer to keep it this way as when it was inline it was really hard to read for me. If you feel strongly about it - I can change it :)
There was a problem hiding this comment.
No problem. In fact, I see on line 2440 of PKCS12KeyStore you have
instant = Instant.ofEpochMilli(
Long.parseLong(keyIdStr.substring(5)));
So I thought you're OK to either style.
There was a problem hiding this comment.
Actually, I just missed this, changed in the next commit. Hope it looks good to you
wangweij
left a comment
There was a problem hiding this comment.
LGTM. Thanks for the fix!
|
Thanks for the reviews @wangweij @seanjmullan @sisahoo |
|
/integrate |
|
Going to push as commit 264fdc5.
Your commit was automatically rebased without conflicts. |
|
@myankelev Pushed as commit 264fdc5. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
Hi!
This is my proposal to transfer
KeyStoreandKeyStoreSpiwith internal implementations to useInstances instead ofDates.I would be very grateful for your comments and suggestions.
Thanks!
P.S. this is related to JDK-8350953
Progress
Issues
Reviewers
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/29140/head:pull/29140$ git checkout pull/29140Update a local copy of the PR:
$ git checkout pull/29140$ git pull https://git.openjdk.org/jdk.git pull/29140/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 29140View PR using the GUI difftool:
$ git pr show -t 29140Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/29140.diff
Using Webrev
Link to Webrev Comment