RFR: 8331008: KDF Implementation

Sean Mullan mullan at openjdk.org
Thu May 9 13:10:56 UTC 2024


On Tue, 23 Apr 2024 20:42:51 GMT, Kevin Driver <kdriver at openjdk.org> wrote:

> Introduce an API for Key Derivation Functions (KDFs), which are cryptographic algorithms for deriving additional keys from a secret key and other data. See [JEP 478](https://openjdk.org/jeps/478).

src/java.base/share/classes/javax/crypto/KDF.java line 110:

> 108: 
> 109:     /**
> 110:      * Returns the algorithm name of this {@code KeyDerivation} object.

s/KeyDerivation/KDF/

There are others that need to be corrected, search for all other instances in this class.

src/java.base/share/classes/javax/crypto/KDF.java line 115:

> 113:      * {@code getInstance} calls that created this {@code KeyDerivation} object.
> 114:      *
> 115:      * @return the algorithm name of this {@code KeyDerivation} object.

Nit: remove period, sentences that don't start with a capital letter and don't have a following sentence should not have period at end

src/java.base/share/classes/javax/crypto/KDF.java line 117:

> 115:      * @return the algorithm name of this {@code KeyDerivation} object.
> 116:      */
> 117:     public final String getAlgorithm() {

The class is final, so none of the methods need to have the final keyword.

src/java.base/share/classes/javax/crypto/KDF.java line 131:

> 129:     }
> 130: 
> 131:     private String getProviderName() {

Make this method public.

src/java.base/share/classes/javax/crypto/KDF.java line 132:

> 130: 
> 131:     private String getProviderName() {
> 132:         return (provider == null) ? "(no provider)" : provider.getName();

I don't think provider should ever be `null`.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/18924#discussion_r1595412923
PR Review Comment: https://git.openjdk.org/jdk/pull/18924#discussion_r1595417284
PR Review Comment: https://git.openjdk.org/jdk/pull/18924#discussion_r1595418793
PR Review Comment: https://git.openjdk.org/jdk/pull/18924#discussion_r1595420936
PR Review Comment: https://git.openjdk.org/jdk/pull/18924#discussion_r1595422427



More information about the security-dev mailing list