8305406: Add @spec tags in java.base/java.* (part 2)

Co-authored-by: Daniel Jeliński <djelinski@openjdk.org>
Co-authored-by: Hannes Wallnöfer <hannesw@openjdk.org>
Reviewed-by: valeriep
This commit is contained in:
Jonathan Gibbons 2024-10-26 06:57:45 +00:00 committed by Hannes Wallnöfer
parent 1476f6c475
commit 873f8a696f
59 changed files with 311 additions and 51 deletions

View file

@ -164,6 +164,10 @@ import sun.security.util.KnownOIDs;
* Consult the release documentation for your implementation to see if any
* other transformations are supported.
*
* @spec https://www.rfc-editor.org/info/rfc5116
* RFC 5116: An Interface and Algorithms for Authenticated Encryption
* @spec https://www.rfc-editor.org/info/rfc7539
* RFC 7539: ChaCha20 and Poly1305 for IETF Protocols
* @author Jan Luehe
* @see KeyGenerator
* @see SecretKey

View file

@ -137,6 +137,8 @@ public class EncryptedPrivateKeyInfo {
* is empty, i.e. 0-length.
* @exception NoSuchAlgorithmException if the specified algName is
* not supported.
*
* @spec security/standard-names.html Java Security Standard Algorithm Names
*/
public EncryptedPrivateKeyInfo(String algName, byte[] encryptedData)
throws NoSuchAlgorithmException {
@ -226,6 +228,8 @@ public class EncryptedPrivateKeyInfo {
* for information about standard Cipher algorithm names.
*
* @return the encryption algorithm name.
*
* @spec security/standard-names.html Java Security Standard Algorithm Names
*/
public String getAlgName() {
return algid == null ? params.getAlgorithm() : algid.getName();

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 1999, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 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
@ -59,6 +59,7 @@
* How to Implement a Provider in the Java Cryptography Architecture}</li>
* </ul>
*
* @spec security/standard-names.html Java Security Standard Algorithm Names
* @since 1.4
*/
package javax.crypto;

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2018, 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
@ -39,6 +39,8 @@ import java.util.Objects;
* <p> This class can be used to initialize a {@code Cipher} object that
* implements the <i>ChaCha20</i> algorithm.
*
* @spec https://www.rfc-editor.org/info/rfc7539
* RFC 7539: ChaCha20 and Poly1305 for IETF Protocols
* @since 11
*/
public final class ChaCha20ParameterSpec implements AlgorithmParameterSpec {

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2011, 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
@ -56,6 +56,12 @@ import java.security.spec.AlgorithmParameterSpec;
* applications. Other values can be specified for this class, but not
* all CSP implementations will support them.
*
* @spec https://www.rfc-editor.org/info/rfc5116
* RFC 5116: An Interface and Algorithms for Authenticated Encryption
* @spec https://csrc.nist.gov/publications/nistpubs/800-38D/SP-800-38D.pdf
* Recommendation for Block Cipher Modes of Operation: Galois/Counter
* Mode (GCM) and GMAC
*
* @see javax.crypto.Cipher
*
* @since 1.7

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 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
@ -72,6 +72,8 @@ import java.security.spec.MGF1ParameterSpec;
* EncodingParameters ::= OCTET STRING(SIZE(0..MAX))
* </pre>
*
* @spec https://www.rfc-editor.org/info/rfc8017
* RFC 8017: PKCS #1: RSA Cryptography Specifications Version 2.2
* @see java.security.spec.MGF1ParameterSpec
* @see PSource
*

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 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
@ -54,6 +54,8 @@ import java.util.Arrays;
* this class requests the password as a char array, so it can be overwritten
* when done.
*
* @spec https://www.rfc-editor.org/info/rfc2898
* RFC 2898: PKCS #5: Password-Based Cryptography Specification Version 2.0
* @author Jan Luehe
* @author Valerie Peng
*

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 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
@ -33,6 +33,8 @@ import java.security.spec.AlgorithmParameterSpec;
* <a href="http://www.ietf.org/rfc/rfc2898.txt">PKCS #5</a>
* standard.
*
* @spec https://www.rfc-editor.org/info/rfc2898
* RFC 2898: PKCS #5: Password-Based Cryptography Specification Version 2.0
* @author Jan Luehe
*
* @since 1.4

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 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
@ -42,6 +42,9 @@ package javax.crypto.spec;
* }
* EncodingParameters ::= OCTET STRING(SIZE(0..MAX))
* </pre>
*
* @spec https://www.rfc-editor.org/info/rfc8017
* RFC 8017: PKCS #1: RSA Cryptography Specifications Version 2.2
* @author Valerie Peng
*
* @since 1.5

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, 2023, 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
@ -39,6 +39,8 @@ import java.util.Arrays;
* <p> This class can be used to initialize a {@code Cipher} object that
* implements the <i>RC2</i> algorithm.
*
* @spec https://www.rfc-editor.org/info/rfc2268
* RFC 2268: A Description of the RC2(r) Encryption Algorithm
* @author Jan Luehe
*
* @since 1.4

View file

@ -39,6 +39,8 @@ import java.util.Arrays;
* <p> This class can be used to initialize a {@code Cipher} object that
* implements the <i>RC5</i> algorithm.
*
* @spec https://www.rfc-editor.org/info/rfc2040
* RFC 2040: The RC5, RC5-CBC, RC5-CBC-Pad, and RC5-CTS Algorithms
* @author Jan Luehe
*
* @since 1.4

View file

@ -98,6 +98,8 @@ public class SecretKeySpec implements KeySpec, SecretKey {
* for information about standard algorithm names.
* @exception IllegalArgumentException if <code>algorithm</code>
* is null or <code>key</code> is null or empty.
*
* @spec security/standard-names.html Java Security Standard Algorithm Names
*/
public SecretKeySpec(byte[] key, String algorithm) {
String errMsg = doSanityCheck(key, algorithm);
@ -144,6 +146,8 @@ public class SecretKeySpec implements KeySpec, SecretKey {
* @exception ArrayIndexOutOfBoundsException is thrown if
* <code>offset</code> or <code>len</code> index bytes outside the
* <code>key</code>.
*
* @spec security/standard-names.html Java Security Standard Algorithm Names
*/
public SecretKeySpec(byte[] key, int offset, int len, String algorithm) {
if (key == null || algorithm == null) {