-
Notifications
You must be signed in to change notification settings - Fork 6.2k
8325513: Export method for Cipher #18409
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
|
👋 Welcome back weijun! A progress list of the required criteria for merging this PR into |
|
❗ This change is not yet ready to be integrated. |
Webrevs
|
|
Why is the |
|
One use case for this method is HPKE key export. Obviously, the exported key won't have algorithm name being "HPKE". |
If |
|
I don't know if any AES cipher defines an export function. As I said earlier the reason I introduce this method is for HPKE. In HPKE, the cipher algorithm name is "HPKE" and the keys used in initialization are asymmetric keys. While the 3rd step in HPKE is an AEAD cipher, I cannot guarantee the export function would only generate a key for this AEAD algorithm. The fact that a length is needed for the function means the output could be anything. Also, there is an export-only mode that does not require an AEAD cipher at all. |
|
In fact, the original definition of export function returns a byte array. I choose the SecretKey return type here simply because it could be non extractable. I am now wondering if there should be also an exportData method. |
|
If this is an HPKE operation, shouldn't it be part of an HPKE API? Why part of Cipher? |
|
I don't think it's worth inventing a new cryptographic engine for HPKE and it is a cipher. |
|
I see that it could work that way, but have we firmly established that HPKE will be implemented in JCE as a Cipher? I see no CSR for this and I would think we'd need one. If we have not firmly established that HPKE is being done as a Cipher, then changing Cipher in advance seems like putting the cart before the horse. I just thought I'd see CSRs in place for JDK-8325513 and/or JDK-8325548 and some kind of consensus on the direction. Maybe I missed an agreement on this approach in the past. |
|
I haven't started JDK-8325548 yet since it requires KDF. Also, I was thinking to get some consensus here on the format of the APIs first and then write the CSR. |
|
As for the cart and horse order, I think you're right. Maybe I should do this in 2 steps:
|
|
That seems like a good approach. If Cipher can address all the use cases for HPKE then is seems more prudent to proceed with #2. As for the KDF impact, do you see a potential Cipher-based HPKE needing to know the details of the KDF API? Or would it just need to know a standard algorithm name for a given KDF? If the latter then you may not need to wait for KDF in order to proceed given where it is in its review cycle. |
|
@wangweij This pull request is now open |
|
@wangweij This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply add a new comment to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration! |
|
@wangweij This pull request has been inactive for more than 8 weeks and will now be automatically closed. If you would like to continue working on this pull request in the future, feel free to reopen it! This can be done using the |
|
/open |
|
@wangweij This pull request is now open |
|
@wangweij This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply issue a |
|
@wangweij This pull request has been inactive for more than 8 weeks and will now be automatically closed. If you would like to continue working on this pull request in the future, feel free to reopen it! This can be done using the |
|
/open |
|
@wangweij This pull request is now open |
|
@wangweij This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply issue a |
|
@wangweij This pull request has been inactive for more than 8 weeks and will now be automatically closed. If you would like to continue working on this pull request in the future, feel free to reopen it! This can be done using the |
|
/open |
|
@wangweij This pull request is now open |
|
@wangweij This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply issue a |
Add
Cipher::exportKeyAPI.Progress
Issues
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/18409/head:pull/18409$ git checkout pull/18409Update a local copy of the PR:
$ git checkout pull/18409$ git pull https://git.openjdk.org/jdk.git pull/18409/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 18409View PR using the GUI difftool:
$ git pr show -t 18409Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/18409.diff
Using Webrev
Link to Webrev Comment