Conversation
Instead of calling pkcs12.Encode, call the Encode method of an Encoder. (Likewise for EncodeTrustStore and EncodeTrustStoreEntries.) The following Encoders are available: * Legacy, for the current behavior. * LegacyDESCerts, to use 3DES for encrypting certificates (Closes #36, Closes #35). * Passwordless, to create password-less trust stores like Java 18 (Closes #10). * Openssl3, to match OpenSSL's modern algorithm choices (Closes #47). * Modern, to always use the most modern choices.
maraino
reviewed
Jul 14, 2023
maraino
reviewed
Jul 14, 2023
3 tasks
Instead make it a property of the Encoder, and provide a WithRand method to customize it. Nearly everyone just uses crypto/rand.Reader anyways.
This was referenced Jul 15, 2023
OpenSSL 3 and Java 20 use the same algorithms by default, but differ in the number of KDF iterations and the KDF salt length. This suggests that there won't be any compatibility problems if I diverge from OpenSSL's salt length. Therefore, Modern2023 uses a salt length of 16.
Member
Author
|
Latest changes:
Testing and feedback much appreciated! |
|
I can confirm that the |
|
+1 this is working for me as well. |
|
|
|
@AGWA when would you be confident to merge this? Really looking forward to it! |
|
Any updates? |
Member
Author
|
Thanks, everyone. I just merged the changes and released v0.3.0. I made the following last-minute API changes:
I discovered during testing that |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Instead of calling
pkcs12.Encode, you now call theEncodemethod of anEncoder(likewise forEncodeTrustStoreandEncodeTrustStoreEntries) which specifies what algorithms/parameters you want to use.The following Encoders are available:
Legacy, for the current behavior.LegacyDESCerts, to use 3DES for encrypting certificates (Closes Support triple DES certificate encryption #36, Closes Support triple DES certificate encryption #35).Passwordless, to create password-less trust stores like Java 18 (Closes Encoding password-less PKCS12 #32).Openssl3, to match OpenSSL 3's modern algorithm choices (PBES2 with AES) (Closes Add Support for Encoding in PBES2 #47).Modern, to always use the most modern choices (currently PBES2 with AES).cc @Marc-Pons, @pivotal-david-osullivan, @Tookmund, @maraino, @hslatman