diff --git a/src/java.base/share/classes/java/security/Key.java b/src/java.base/share/classes/java/security/Key.java index 190a3db299978..ce61707dcdcb5 100644 --- a/src/java.base/share/classes/java/security/Key.java +++ b/src/java.base/share/classes/java/security/Key.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2025, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -121,9 +121,8 @@ public interface Key extends java.io.Serializable { /** * Returns the standard algorithm name for this key. For * example, "DSA" would indicate that this key is a DSA key. - * See the key related sections (KeyFactory, KeyGenerator, - * KeyPairGenerator, and SecretKeyFactory) in the + * See the Key Algorithms section in the + * * Java Security Standard Algorithm Names Specification * for information about standard key algorithm names. * diff --git a/src/java.base/share/classes/java/security/spec/EncodedKeySpec.java b/src/java.base/share/classes/java/security/spec/EncodedKeySpec.java index 8bb23d08df35b..104a8f21ec488 100644 --- a/src/java.base/share/classes/java/security/spec/EncodedKeySpec.java +++ b/src/java.base/share/classes/java/security/spec/EncodedKeySpec.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2025, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -74,11 +74,11 @@ public EncodedKeySpec(byte[] encodedKey) { * * @param encodedKey the encoded key. The contents of the * array are copied to protect against subsequent modification. - * @param algorithm the algorithm name of the encoded key - * See the KeyFactory section in the + * @param algorithm the algorithm name of the encoded key. + * See the AsymmetricKey Algorithms section in the + * * Java Security Standard Algorithm Names Specification - * for information about standard algorithm names. + * for information about standard asymmetric key algorithm names. * @throws NullPointerException if {@code encodedKey} * or {@code algorithm} is null. * @throws IllegalArgumentException if {@code algorithm} is diff --git a/src/java.base/share/classes/java/security/spec/PKCS8EncodedKeySpec.java b/src/java.base/share/classes/java/security/spec/PKCS8EncodedKeySpec.java index 73d79a413216b..dd14d914e254d 100644 --- a/src/java.base/share/classes/java/security/spec/PKCS8EncodedKeySpec.java +++ b/src/java.base/share/classes/java/security/spec/PKCS8EncodedKeySpec.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2025, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -83,11 +83,11 @@ public PKCS8EncodedKeySpec(byte[] encodedKey) { * @param encodedKey the key, which is assumed to be * encoded according to the PKCS #8 standard. The contents of * the array are copied to protect against subsequent modification. - * @param algorithm the algorithm name of the encoded private key - * See the KeyFactory section in the + * @param algorithm the algorithm name of the encoded private key. + * See the AsymmetricKey Algorithms section in the + * * Java Security Standard Algorithm Names Specification - * for information about standard algorithm names. + * for information about standard asymmetric key algorithm names. * @throws NullPointerException if {@code encodedKey} * or {@code algorithm} is null. * @throws IllegalArgumentException if {@code algorithm} is diff --git a/src/java.base/share/classes/java/security/spec/X509EncodedKeySpec.java b/src/java.base/share/classes/java/security/spec/X509EncodedKeySpec.java index 7de4a2a14179a..89748a1d228cc 100644 --- a/src/java.base/share/classes/java/security/spec/X509EncodedKeySpec.java +++ b/src/java.base/share/classes/java/security/spec/X509EncodedKeySpec.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2025, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -74,10 +74,10 @@ public X509EncodedKeySpec(byte[] encodedKey) { * encoded according to the X.509 standard. The contents of the * array are copied to protect against subsequent modification. * @param algorithm the algorithm name of the encoded public key - * See the KeyFactory section in the + * See the AsymmetricKey Algorithms section in the + * * Java Security Standard Algorithm Names Specification - * for information about standard algorithm names. + * for information about standard asymmetric key algorithm names. * @throws NullPointerException if {@code encodedKey} * or {@code algorithm} is null. * @throws IllegalArgumentException if {@code algorithm} is diff --git a/src/java.base/share/classes/javax/crypto/KDF.java b/src/java.base/share/classes/javax/crypto/KDF.java index 0ee0904c1c2c4..446d3757e9a8b 100644 --- a/src/java.base/share/classes/javax/crypto/KDF.java +++ b/src/java.base/share/classes/javax/crypto/KDF.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2024, 2025, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -477,7 +477,11 @@ private static KDF handleException(NoSuchAlgorithmException e) * Derives a key, returned as a {@code SecretKey} object. * * @param alg - * the algorithm of the resultant {@code SecretKey} object + * the algorithm of the resultant {@code SecretKey} object. + * See the SecretKey Algorithms section in the + * + * Java Security Standard Algorithm Names Specification + * for information about standard secret key algorithm names. * @param derivationSpec * the object describing the inputs to the derivation function * diff --git a/src/java.base/share/classes/javax/crypto/KDFSpi.java b/src/java.base/share/classes/javax/crypto/KDFSpi.java index dcd2029c0c06f..de021e87b7a25 100644 --- a/src/java.base/share/classes/javax/crypto/KDFSpi.java +++ b/src/java.base/share/classes/javax/crypto/KDFSpi.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2024, 2025, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -115,7 +115,11 @@ protected KDFSpi(KDFParameters kdfParameters) * result of {@code deriveData}. * * @param alg - * the algorithm of the resultant {@code SecretKey} object + * the algorithm of the resultant {@code SecretKey} object. + * See the SecretKey Algorithms section in the + * + * Java Security Standard Algorithm Names Specification + * for information about standard secret key algorithm names. * @param derivationSpec * derivation parameters * @@ -154,4 +158,4 @@ protected abstract byte[] engineDeriveData( AlgorithmParameterSpec derivationSpec) throws InvalidAlgorithmParameterException; -} \ No newline at end of file +} diff --git a/src/java.base/share/classes/javax/crypto/KEM.java b/src/java.base/share/classes/javax/crypto/KEM.java index 3cb053c194c48..f8d9beca72938 100644 --- a/src/java.base/share/classes/javax/crypto/KEM.java +++ b/src/java.base/share/classes/javax/crypto/KEM.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2023, 2025, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -222,7 +222,13 @@ public Encapsulated encapsulate() { * to be returned, inclusive * @param to the final index of the shared secret byte array * to be returned, exclusive - * @param algorithm the algorithm name for the secret key that is returned + * @param algorithm the algorithm name for the secret key that is returned. + * See the SecretKey Algorithms section in the + * + * Java Security Standard Algorithm Names Specification + * for information about standard secret key algorithm names. + * Use "Generic" if the output will be used as the input keying + * material of a key derivation function (KDF). * @return a {@link Encapsulated} object containing a portion of * the shared secret, key encapsulation message, and optional * parameters. The portion of the shared secret is a @@ -345,7 +351,13 @@ public SecretKey decapsulate(byte[] encapsulation) throws DecapsulateException { * to be returned, inclusive * @param to the final index of the shared secret byte array * to be returned, exclusive - * @param algorithm the algorithm name for the secret key that is returned + * @param algorithm the algorithm name for the secret key that is returned. + * See the SecretKey Algorithms section in the + * + * Java Security Standard Algorithm Names Specification + * for information about standard secret key algorithm names. + * Use "Generic" if the output will be used as the input keying + * material of a key derivation function (KDF). * @return a portion of the shared secret as a {@code SecretKey} * containing the bytes of the secret ranging from {@code from} * to {@code to}, exclusive, and an algorithm name as specified. diff --git a/src/java.base/share/classes/javax/crypto/KEMSpi.java b/src/java.base/share/classes/javax/crypto/KEMSpi.java index 61d13aeb02417..3c033520394af 100644 --- a/src/java.base/share/classes/javax/crypto/KEMSpi.java +++ b/src/java.base/share/classes/javax/crypto/KEMSpi.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2023, 2025, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -129,7 +129,13 @@ interface EncapsulatorSpi { * to be returned, inclusive * @param to the final index of the shared secret byte array * to be returned, exclusive - * @param algorithm the algorithm name for the secret key that is returned + * @param algorithm the algorithm name for the secret key that is returned. + * See the SecretKey Algorithms section in the + * + * Java Security Standard Algorithm Names Specification + * for information about standard secret key algorithm names. + * Use "Generic" if the output will be used as the input keying + * material of a key derivation function (KDF). * @return an {@link KEM.Encapsulated} object containing a portion of * the shared secret as a key with the specified algorithm, * key encapsulation message, and optional parameters. @@ -188,7 +194,13 @@ interface DecapsulatorSpi { * to be returned, inclusive * @param to the final index of the shared secret byte array * to be returned, exclusive - * @param algorithm the algorithm name for the secret key that is returned + * @param algorithm the algorithm name for the secret key that is returned. + * See the SecretKey Algorithms section in the + * + * Java Security Standard Algorithm Names Specification + * for information about standard secret key algorithm names. + * Use "Generic" if the output will be used as the input keying + * material of a key derivation function (KDF). * @return a portion of the shared secret as a {@code SecretKey} with * the specified algorithm * @throws DecapsulateException if an error occurs during the diff --git a/src/java.base/share/classes/javax/crypto/spec/SecretKeySpec.java b/src/java.base/share/classes/javax/crypto/spec/SecretKeySpec.java index d36510a21a82f..be185cb34ad11 100644 --- a/src/java.base/share/classes/javax/crypto/spec/SecretKeySpec.java +++ b/src/java.base/share/classes/javax/crypto/spec/SecretKeySpec.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2025, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -93,9 +93,10 @@ public class SecretKeySpec implements KeySpec, SecretKey { * the array are copied to protect against subsequent modification. * @param algorithm the name of the secret-key algorithm to be associated * with the given key material. - * See the - * Java Security Standard Algorithm Names document - * for information about standard algorithm names. + * See the SecretKey Algorithms section in the + * + * Java Security Standard Algorithm Names Specification + * for information about standard secret key algorithm names. * @exception IllegalArgumentException if algorithm * is null or key is null or empty. * @@ -137,9 +138,10 @@ public SecretKeySpec(byte[] key, String algorithm) { * @param len the length of the key material. * @param algorithm the name of the secret-key algorithm to be associated * with the given key material. - * See the - * Java Security Standard Algorithm Names document - * for information about standard algorithm names. + * See the SecretKey Algorithms section in the + * + * Java Security Standard Algorithm Names Specification + * for information about standard secret key algorithm names. * @exception IllegalArgumentException if algorithm * is null or key is null, empty, or too short, * i.e. {@code key.length-offset