Skip to content

Commit

Permalink
revert unrelated changes
Browse files Browse the repository at this point in the history
  • Loading branch information
wangweij committed Jan 6, 2025
1 parent 7110bf9 commit af2e2b7
Show file tree
Hide file tree
Showing 9 changed files with 36 additions and 69 deletions.
7 changes: 4 additions & 3 deletions src/java.base/share/classes/java/security/Key.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1996, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1996, 2024, 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
Expand Down Expand Up @@ -121,8 +121,9 @@ 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 Algorithms section in the
* <a href="{@docRoot}/../specs/security/standard-names.html#key-algorithms">
* See the key related sections (KeyFactory, KeyGenerator,
* KeyPairGenerator, and SecretKeyFactory) in the <a href=
* "{@docRoot}/../specs/security/standard-names.html">
* Java Security Standard Algorithm Names Specification</a>
* for information about standard key algorithm names.
*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2022, 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
Expand Down Expand Up @@ -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 AsymmetricKey Algorithms section in the
* <a href="{@docRoot}/../specs/security/standard-names.html#asymmetrickey-algorithms">
* @param algorithm the algorithm name of the encoded key
* See the KeyFactory section in the <a href=
* "{@docRoot}/../specs/security/standard-names.html#keyfactory-algorithms">
* Java Security Standard Algorithm Names Specification</a>
* for information about standard asymmetric key algorithm names.
* for information about standard algorithm names.
* @throws NullPointerException if {@code encodedKey}
* or {@code algorithm} is null.
* @throws IllegalArgumentException if {@code algorithm} is
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2017, 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
Expand Down Expand Up @@ -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 AsymmetricKey Algorithms section in the
* <a href="{@docRoot}/../specs/security/standard-names.html#asymmetrickey-algorithms">
* @param algorithm the algorithm name of the encoded private key
* See the KeyFactory section in the <a href=
* "{@docRoot}/../specs/security/standard-names.html#keyfactory-algorithms">
* Java Security Standard Algorithm Names Specification</a>
* for information about standard asymmetric key algorithm names.
* for information about standard algorithm names.
* @throws NullPointerException if {@code encodedKey}
* or {@code algorithm} is null.
* @throws IllegalArgumentException if {@code algorithm} is
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2017, 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
Expand Down Expand Up @@ -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 AsymmetricKey Algorithms section in the
* <a href="{@docRoot}/../specs/security/standard-names.html#asymmetrickey-algorithms">
* See the KeyFactory section in the <a href=
* "{@docRoot}/../specs/security/standard-names.html#keyfactory-algorithms">
* Java Security Standard Algorithm Names Specification</a>
* for information about standard asymmetric key algorithm names.
* for information about standard algorithm names.
* @throws NullPointerException if {@code encodedKey}
* or {@code algorithm} is null.
* @throws IllegalArgumentException if {@code algorithm} is
Expand Down
8 changes: 2 additions & 6 deletions src/java.base/share/classes/javax/crypto/KDF.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2024, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2024, 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
Expand Down Expand Up @@ -477,11 +477,7 @@ 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.
* See the SecretKey Algorithms section in the
* <a href="{@docRoot}/../specs/security/standard-names.html#secretkey-algorithms">
* Java Security Standard Algorithm Names Specification</a>
* for information about standard secret key algorithm names.
* the algorithm of the resultant {@code SecretKey} object
* @param derivationSpec
* the object describing the inputs to the derivation function
*
Expand Down
10 changes: 3 additions & 7 deletions src/java.base/share/classes/javax/crypto/KDFSpi.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2024, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2024, 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
Expand Down Expand Up @@ -115,11 +115,7 @@ protected KDFSpi(KDFParameters kdfParameters)
* result of {@code deriveData}.
*
* @param alg
* the algorithm of the resultant {@code SecretKey} object.
* See the SecretKey Algorithms section in the
* <a href="{@docRoot}/../specs/security/standard-names.html#secretkey-algorithms">
* Java Security Standard Algorithm Names Specification</a>
* for information about standard secret key algorithm names.
* the algorithm of the resultant {@code SecretKey} object
* @param derivationSpec
* derivation parameters
*
Expand Down Expand Up @@ -158,4 +154,4 @@ protected abstract byte[] engineDeriveData(
AlgorithmParameterSpec derivationSpec)
throws InvalidAlgorithmParameterException;

}
}
18 changes: 3 additions & 15 deletions src/java.base/share/classes/javax/crypto/KEM.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2023, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2023, 2024, 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
Expand Down Expand Up @@ -222,13 +222,7 @@ 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.
* See the SecretKey Algorithms section in the
* <a href="{@docRoot}/../specs/security/standard-names.html#secretkey-algorithms">
* Java Security Standard Algorithm Names Specification</a>
* 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).
* @param algorithm the algorithm name for the secret key that is returned
* @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
Expand Down Expand Up @@ -351,13 +345,7 @@ 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.
* See the SecretKey Algorithms section in the
* <a href="{@docRoot}/../specs/security/standard-names.html#secretkey-algorithms">
* Java Security Standard Algorithm Names Specification</a>
* 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).
* @param algorithm the algorithm name for the secret key that is returned
* @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.
Expand Down
18 changes: 3 additions & 15 deletions src/java.base/share/classes/javax/crypto/KEMSpi.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2023, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2023, 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
Expand Down Expand Up @@ -129,13 +129,7 @@ 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.
* See the SecretKey Algorithms section in the
* <a href="{@docRoot}/../specs/security/standard-names.html#secretkey-algorithms">
* Java Security Standard Algorithm Names Specification</a>
* 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).
* @param algorithm the algorithm name for the secret key that is returned
* @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.
Expand Down Expand Up @@ -194,13 +188,7 @@ 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.
* See the SecretKey Algorithms section in the
* <a href="{@docRoot}/../specs/security/standard-names.html#secretkey-algorithms">
* Java Security Standard Algorithm Names Specification</a>
* 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).
* @param algorithm the algorithm name for the secret key that is returned
* @return a portion of the shared secret as a {@code SecretKey} with
* the specified algorithm
* @throws DecapsulateException if an error occurs during the
Expand Down
16 changes: 7 additions & 9 deletions src/java.base/share/classes/javax/crypto/spec/SecretKeySpec.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 2024, 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
Expand Down Expand Up @@ -93,10 +93,9 @@ 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 SecretKey Algorithms section in the
* <a href="{@docRoot}/../specs/security/standard-names.html#secretkey-algorithms">
* Java Security Standard Algorithm Names Specification</a>
* for information about standard secret key algorithm names.
* See the <a href="{@docRoot}/../specs/security/standard-names.html">
* Java Security Standard Algorithm Names</a> document
* for information about standard algorithm names.
* @exception IllegalArgumentException if <code>algorithm</code>
* is null or <code>key</code> is null or empty.
*
Expand Down Expand Up @@ -138,10 +137,9 @@ 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 SecretKey Algorithms section in the
* <a href="{@docRoot}/../specs/security/standard-names.html#secretkey-algorithms">
* Java Security Standard Algorithm Names Specification</a>
* for information about standard secret key algorithm names.
* See the <a href="{@docRoot}/../specs/security/standard-names.html">
* Java Security Standard Algorithm Names</a> document
* for information about standard algorithm names.
* @exception IllegalArgumentException if <code>algorithm</code>
* is null or <code>key</code> is null, empty, or too short,
* i.e. {@code key.length-offset<len}.
Expand Down

0 comments on commit af2e2b7

Please sign in to comment.