java.security.interfaces: update classes in java.security.interfaces
Pulling upstream changes from OpenJDK version jdk8u60 for all classes
in java.security.interfaces
This commit contains cosmetic JavaDoc changes like use of @code in
place of <code> tags, use of a package-info.java in
place of a package.html file and new comments.
Change-Id: I0d27939cda2af5317ee25c677b32f1540d63cafb
Test: check-ojluni-files and make droid docs
Bug: 29631070
diff --git a/ojluni/src/main/java/java/security/interfaces/DSAKeyPairGenerator.java b/ojluni/src/main/java/java/security/interfaces/DSAKeyPairGenerator.java
index d86bbbc..e50cfd2 100644
--- a/ojluni/src/main/java/java/security/interfaces/DSAKeyPairGenerator.java
+++ b/ojluni/src/main/java/java/security/interfaces/DSAKeyPairGenerator.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2013, 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
@@ -30,8 +30,8 @@
/**
* An interface to an object capable of generating DSA key pairs.
*
- * <p>The <code>initialize</code> methods may each be called any number
- * of times. If no <code>initialize</code> method is called on a
+ * <p>The {@code initialize} methods may each be called any number
+ * of times. If no {@code initialize} method is called on a
* DSAKeyPairGenerator, the default is to generate 1024-bit keys, using
* precomputed p, q and g parameters and an instance of SecureRandom as
* the random bit source.
@@ -42,26 +42,29 @@
* <ol>
*
* <li>Get a key pair generator for the DSA algorithm by calling the
- * KeyPairGenerator <code>getInstance</code> method with "DSA"
- * as its argument.<p>
+ * KeyPairGenerator {@code getInstance} method with "DSA"
+ * as its argument.
*
* <li>Initialize the generator by casting the result to a DSAKeyPairGenerator
* and calling one of the
- * <code>initialize</code> methods from this DSAKeyPairGenerator interface.<p>
+ * {@code initialize} methods from this DSAKeyPairGenerator interface.
*
- * <li>Generate a key pair by calling the <code>generateKeyPair</code>
+ * <li>Generate a key pair by calling the {@code generateKeyPair}
* method from the KeyPairGenerator class.
*
* </ol>
*
* <p>Note: it is not always necessary to do do algorithm-specific
* initialization for a DSA key pair generator. That is, it is not always
- * necessary to call an <code>initialize</code> method in this interface.
- * Algorithm-independent initialization using the <code>initialize</code> method
+ * necessary to call an {@code initialize} method in this interface.
+ * Algorithm-independent initialization using the {@code initialize} method
* in the KeyPairGenerator
* interface is all that is needed when you accept defaults for algorithm-specific
* parameters.
*
+ * <p>Note: Some earlier implementations of this interface may not support
+ * larger sizes of DSA parameters such as 2048 and 3072-bit.
+ *
* @see java.security.KeyPairGenerator
*/
public interface DSAKeyPairGenerator {
@@ -77,8 +80,8 @@
* @param random the random bit source to use to generate key bits;
* can be null.
*
- * @exception InvalidParameterException if the <code>params</code>
- * value is invalid or null.
+ * @exception InvalidParameterException if the {@code params}
+ * value is invalid, null, or unsupported.
*/
public void initialize(DSAParams params, SecureRandom random)
throws InvalidParameterException;
@@ -89,7 +92,7 @@
* If a SecureRandom bit source is needed but not supplied, i.e.
* null, a default SecureRandom instance will be used.
*
- * <p>If <code>genParams</code> is true, this method generates new
+ * <p>If {@code genParams} is true, this method generates new
* p, q and g parameters. If it is false, the method uses precomputed
* parameters for the modulus length requested. If there are no
* precomputed parameters for that modulus length, an exception will be
@@ -97,7 +100,7 @@
* default parameters for modulus lengths of 512 and 1024 bits.
*
* @param modlen the modulus length in bits. Valid values are any
- * multiple of 8 between 512 and 1024, inclusive.
+ * multiple of 64 between 512 and 1024, inclusive, 2048, and 3072.
*
* @param random the random bit source to use to generate key bits;
* can be null.
@@ -105,10 +108,9 @@
* @param genParams whether or not to generate new parameters for
* the modulus length requested.
*
- * @exception InvalidParameterException if <code>modlen</code> is not
- * between 512 and 1024, or if <code>genParams</code> is false and
- * there are no precomputed parameters for the requested modulus
- * length.
+ * @exception InvalidParameterException if {@code modlen} is
+ * invalid, or unsupported, or if {@code genParams} is false and there
+ * are no precomputed parameters for the requested modulus length.
*/
public void initialize(int modlen, boolean genParams, SecureRandom random)
throws InvalidParameterException;
diff --git a/ojluni/src/main/java/java/security/interfaces/DSAParams.java b/ojluni/src/main/java/java/security/interfaces/DSAParams.java
index f20b8ec..b672ad5 100644
--- a/ojluni/src/main/java/java/security/interfaces/DSAParams.java
+++ b/ojluni/src/main/java/java/security/interfaces/DSAParams.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1996, 1998, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2013, 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,23 +42,23 @@
public interface DSAParams {
/**
- * Returns the prime, <code>p</code>.
+ * Returns the prime, {@code p}.
*
- * @return the prime, <code>p</code>.
+ * @return the prime, {@code p}.
*/
public BigInteger getP();
/**
- * Returns the subprime, <code>q</code>.
+ * Returns the subprime, {@code q}.
*
- * @return the subprime, <code>q</code>.
+ * @return the subprime, {@code q}.
*/
public BigInteger getQ();
/**
- * Returns the base, <code>g</code>.
+ * Returns the base, {@code g}.
*
- * @return the base, <code>g</code>.
+ * @return the base, {@code g}.
*/
public BigInteger getG();
}
diff --git a/ojluni/src/main/java/java/security/interfaces/DSAPrivateKey.java b/ojluni/src/main/java/java/security/interfaces/DSAPrivateKey.java
index a0d1893..81ab358 100644
--- a/ojluni/src/main/java/java/security/interfaces/DSAPrivateKey.java
+++ b/ojluni/src/main/java/java/security/interfaces/DSAPrivateKey.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 1999, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2013, 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
@@ -50,9 +50,9 @@
static final long serialVersionUID = 7776497482533790279L;
/**
- * Returns the value of the private key, <code>x</code>.
+ * Returns the value of the private key, {@code x}.
*
- * @return the value of the private key, <code>x</code>.
+ * @return the value of the private key, {@code x}.
*/
public BigInteger getX();
}
diff --git a/ojluni/src/main/java/java/security/interfaces/DSAPublicKey.java b/ojluni/src/main/java/java/security/interfaces/DSAPublicKey.java
index b273738..e56b795 100644
--- a/ojluni/src/main/java/java/security/interfaces/DSAPublicKey.java
+++ b/ojluni/src/main/java/java/security/interfaces/DSAPublicKey.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1996, 1999, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2013, 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
@@ -50,9 +50,9 @@
static final long serialVersionUID = 1234526332779022332L;
/**
- * Returns the value of the public key, <code>y</code>.
+ * Returns the value of the public key, {@code y}.
*
- * @return the value of the public key, <code>y</code>.
+ * @return the value of the public key, {@code y}.
*/
public BigInteger getY();
}
diff --git a/ojluni/src/main/java/java/security/interfaces/RSAMultiPrimePrivateCrtKey.java b/ojluni/src/main/java/java/security/interfaces/RSAMultiPrimePrivateCrtKey.java
index 19cddce..f85d96a 100644
--- a/ojluni/src/main/java/java/security/interfaces/RSAMultiPrimePrivateCrtKey.java
+++ b/ojluni/src/main/java/java/security/interfaces/RSAMultiPrimePrivateCrtKey.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2013, 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
@@ -46,6 +46,11 @@
public interface RSAMultiPrimePrivateCrtKey extends RSAPrivateKey {
+ /**
+ * The type fingerprint that is set to indicate
+ * serialization compatibility with a previous
+ * version of the type.
+ */
static final long serialVersionUID = 618058533534628008L;
/**
diff --git a/ojluni/src/main/java/java/security/interfaces/RSAPrivateCrtKey.java b/ojluni/src/main/java/java/security/interfaces/RSAPrivateCrtKey.java
index 670af46..0408fea 100644
--- a/ojluni/src/main/java/java/security/interfaces/RSAPrivateCrtKey.java
+++ b/ojluni/src/main/java/java/security/interfaces/RSAPrivateCrtKey.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2013, 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,11 @@
public interface RSAPrivateCrtKey extends RSAPrivateKey {
+ /**
+ * The type fingerprint that is set to indicate
+ * serialization compatibility with a previous
+ * version of the type.
+ */
static final long serialVersionUID = -5682214253527700368L;
/**
diff --git a/ojluni/src/main/java/java/security/interfaces/RSAPrivateKey.java b/ojluni/src/main/java/java/security/interfaces/RSAPrivateKey.java
index 522c5ba..5d69ad6 100644
--- a/ojluni/src/main/java/java/security/interfaces/RSAPrivateKey.java
+++ b/ojluni/src/main/java/java/security/interfaces/RSAPrivateKey.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2013, 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,11 @@
public interface RSAPrivateKey extends java.security.PrivateKey, RSAKey
{
+ /**
+ * The type fingerprint that is set to indicate
+ * serialization compatibility with a previous
+ * version of the type.
+ */
static final long serialVersionUID = 5187144804936595022L;
/**
diff --git a/ojluni/src/main/java/java/security/interfaces/RSAPublicKey.java b/ojluni/src/main/java/java/security/interfaces/RSAPublicKey.java
index 04d80cf..a698c05 100644
--- a/ojluni/src/main/java/java/security/interfaces/RSAPublicKey.java
+++ b/ojluni/src/main/java/java/security/interfaces/RSAPublicKey.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2013, 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
@@ -36,6 +36,11 @@
public interface RSAPublicKey extends java.security.PublicKey, RSAKey
{
+ /**
+ * The type fingerprint that is set to indicate
+ * serialization compatibility with a previous
+ * version of the type.
+ */
static final long serialVersionUID = -8727434096241101194L;
/**
diff --git a/ojluni/src/main/java/java/security/interfaces/package-info.java b/ojluni/src/main/java/java/security/interfaces/package-info.java
new file mode 100644
index 0000000..a2d77da
--- /dev/null
+++ b/ojluni/src/main/java/java/security/interfaces/package-info.java
@@ -0,0 +1,74 @@
+/*
+ * Copyright (c) 1998, 2013, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * Provides interfaces for generating RSA (Rivest, Shamir and
+ * Adleman AsymmetricCipher algorithm)
+ * keys as defined in the RSA Laboratory Technical Note
+ * PKCS#1, and DSA (Digital Signature
+ * Algorithm) keys as defined in NIST's FIPS-186.
+ * <P>
+ * Note that these interfaces are intended only for key
+ * implementations whose key material is accessible and
+ * available. These interfaces are not intended for key
+ * implementations whose key material resides in
+ * inaccessible, protected storage (such as in a
+ * hardware device).
+ * <P>
+ * For more developer information on how to use these
+ * interfaces, including information on how to design
+ * {@code Key} classes for hardware devices, please refer
+ * to these cryptographic provider developer guides:
+ * <ul>
+ * <li><a href=
+ * "{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/security/crypto/HowToImplAProvider.html">
+ * <b>How to Implement a Provider for the
+ * Java™ Cryptography Architecture
+ * </b></a></li>
+ * </ul>
+ *
+ * <h2>Package Specification</h2>
+ *
+ * <ul>
+ * <li>PKCS #1: RSA Encryption Standard, Version 1.5, November 1993 </li>
+ * <li>Federal Information Processing Standards Publication (FIPS PUB) 186:
+ * Digital Signature Standard (DSS) </li>
+ * </ul>
+ *
+ * <h2>Related Documentation</h2>
+ *
+ * For further documentation, please see:
+ * <ul>
+ * <li>
+ * <a href=
+ * "{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/security/crypto/CryptoSpec.html">
+ * <b>Java™
+ * Cryptography Architecture API Specification and Reference
+ * </b></a></li>
+ * </ul>
+ *
+ * @since JDK1.1
+ */
+package java.security.interfaces;
diff --git a/openjdk_java_files.mk b/openjdk_java_files.mk
index 1fc510b..5bb3ae0 100644
--- a/openjdk_java_files.mk
+++ b/openjdk_java_files.mk
@@ -589,6 +589,7 @@
ojluni/src/main/java/java/security/interfaces/RSAPrivateCrtKey.java \
ojluni/src/main/java/java/security/interfaces/RSAPrivateKey.java \
ojluni/src/main/java/java/security/interfaces/RSAPublicKey.java \
+ ojluni/src/main/java/java/security/interfaces/package-info.java \
ojluni/src/main/java/java/security/InvalidAlgorithmParameterException.java \
ojluni/src/main/java/java/security/InvalidKeyException.java \
ojluni/src/main/java/java/security/InvalidParameterException.java \