harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From telli...@apache.org
Subject svn commit: r767909 [3/3] - in /harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/javax/crypto: ./ interfaces/ spec/
Date Thu, 23 Apr 2009 12:57:19 GMT
Modified: harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/javax/crypto/spec/DESKeySpec.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/javax/crypto/spec/DESKeySpec.java?rev=767909&r1=767908&r2=767909&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/javax/crypto/spec/DESKeySpec.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/javax/crypto/spec/DESKeySpec.java
Thu Apr 23 12:57:17 2009
@@ -23,12 +23,12 @@
 import org.apache.harmony.crypto.internal.nls.Messages;
 
 /**
- * @com.intel.drl.spec_ref
+ * The key specification for a DES key.
  */
 public class DESKeySpec implements KeySpec {
 
     /**
-     * @com.intel.drl.spec_ref
+     * The length of a DES key in bytes.
      */
     public static final int DES_KEY_LEN = 8;
 
@@ -92,14 +92,29 @@
                 };
 
     /**
-     * @com.intel.drl.spec_ref
+     * Creates a new <code>DESKeySpec</code> from the first 8 bytes of the
+     * specified key data.
+     *
+     * @param key
+     *            the key data.
+     * @throws InvalidKeyException
+     *             if the length of the specified key data is less than 8.
      */
     public DESKeySpec(byte[] key) throws InvalidKeyException {
         this(key, 0);
     }
 
     /**
-     * @com.intel.drl.spec_ref
+     * Creates a new <code>DESKeySpec</code> from the first 8 bytes of the
+     * specified key data starting at <code>offset</code>.
+     *
+     * @param key
+     *            the key data
+     * @param offset
+     *            the offset to start at.
+     * @throws InvalidKeyException
+     *             if the length of the specified key data starting at offset is
+     *             less than 8.
      */
     public DESKeySpec(byte[] key, int offset)
                 throws InvalidKeyException {
@@ -115,7 +130,9 @@
     }
 
     /**
-     * @com.intel.drl.spec_ref
+     * Returns a copy of the key.
+     *
+     * @return a copy of the key.
      */
     public byte[] getKey() {
         byte[] result = new byte[DES_KEY_LEN];
@@ -124,7 +141,18 @@
     }
 
     /**
-     * @com.intel.drl.spec_ref
+     * Returns whether the specified key data starting at <code>offset</code>
is
+     * <i>parity-adjusted</i>.
+     *
+     * @param key
+     *            the key data.
+     * @param offset
+     *            the offset to start checking at.
+     * @return {@code true} if the specified key data is parity-adjusted,
+     *            {@code false} otherwise.
+     * @throws InvalidKeyException
+     *             if the length of the key data starting at offset is less than
+     *             8, or the key is null.
      */
     public static boolean isParityAdjusted(byte[] key, int offset)
             throws InvalidKeyException {
@@ -153,7 +181,17 @@
     }
 
     /**
-     * @com.intel.drl.spec_ref
+     * Returns whether the specified key data starting at <code>offset</code>
is
+     * weak or semi-weak.
+     *
+     * @param key
+     *            the key data.
+     * @param offset
+     *            the offset to start checking at.
+     * @return {@code true} if the specified key data is weak or semi-weak.
+     * @throws InvalidKeyException
+     *             if the length of the key data starting at offset is less than
+     *             8, or it is null.
      */
     public static boolean isWeak(byte[] key, int offset)
               throws InvalidKeyException {

Modified: harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/javax/crypto/spec/DESedeKeySpec.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/javax/crypto/spec/DESedeKeySpec.java?rev=767909&r1=767908&r2=767909&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/javax/crypto/spec/DESedeKeySpec.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/javax/crypto/spec/DESedeKeySpec.java
Thu Apr 23 12:57:17 2009
@@ -27,19 +27,27 @@
 import org.apache.harmony.crypto.internal.nls.Messages;
 
 /**
- * @com.intel.drl.spec_ref
+ * The key specification for a triple-DES (DES-EDE) key.
  */
 public class DESedeKeySpec implements KeySpec {
 
     /**
-     * @com.intel.drl.spec_ref
+     * The length of a DES-EDE key in bytes.
      */
     public static final int DES_EDE_KEY_LEN = 24;
 
     private final byte[] key;
 
     /**
-     * @com.intel.drl.spec_ref
+     * Creates a new <code>DESedeKeySpec</code> instance from the first 24 (
+     * {@link #DES_EDE_KEY_LEN}) bytes of the specified key data.
+     *
+     * @param key
+     *            the key data.
+     * @throws InvalidKeyException
+     *             if the length of the key data is less than 24.
+     * @throws NullPointerException
+     *             if the key data is null.
      */
     public DESedeKeySpec(byte[] key)
                 throws InvalidKeyException {
@@ -55,7 +63,19 @@
     }
 
     /**
-     * @com.intel.drl.spec_ref
+     * Creates a new <code>DESedeKeySpec</code> instance from the first 24 (
+     * {@link #DES_EDE_KEY_LEN} ) bytes of the specified key data starting at
+     * <code>offset</code>.
+     *
+     * @param key
+     *            the key data
+     * @param offset
+     *            the offset to start at.
+     * @throws InvalidKeyException
+     *             if the length of the key data starting at offset is less than
+     *             24.
+     * @throws NullPointerException
+     *             if the key data is null.
      */
     public DESedeKeySpec(byte[] key, int offset)
                 throws InvalidKeyException {
@@ -71,7 +91,9 @@
     }
 
     /**
-     * @com.intel.drl.spec_ref
+     * Returns a copy of the key.
+     *
+     * @return a copy of the key.
      */
     public byte[] getKey() {
         byte[] result = new byte [DES_EDE_KEY_LEN];
@@ -80,7 +102,18 @@
     }
 
     /**
-     * @com.intel.drl.spec_ref
+     * Returns whether the specified key data starting at <code>offset</code>
is
+     * <i>parity-adjusted</i>.
+     *
+     * @param key
+     *            the key data.
+     * @param offset
+     *            the offset to start checking at.
+     * @return {@code true} if the specified key data is parity-adjusted,
+     *            {@code false} otherwise.
+     * @throws InvalidKeyException
+     *             if the length of the key data starting at offset is less than
+     *             24.
      */
     public static boolean isParityAdjusted(byte[] key, int offset)
                 throws InvalidKeyException {

Modified: harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/javax/crypto/spec/DHGenParameterSpec.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/javax/crypto/spec/DHGenParameterSpec.java?rev=767909&r1=767908&r2=767909&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/javax/crypto/spec/DHGenParameterSpec.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/javax/crypto/spec/DHGenParameterSpec.java
Thu Apr 23 12:57:17 2009
@@ -25,7 +25,8 @@
 import java.security.spec.AlgorithmParameterSpec;
 
 /**
- * @com.intel.drl.spec_ref
+ * The algorithm parameter specification for generating Diffie-Hellman
+ * parameters used in Diffie-Hellman key agreement.
  */
 public class DHGenParameterSpec implements AlgorithmParameterSpec {
 
@@ -33,7 +34,13 @@
     private final int exponentSize;
 
     /**
-     * @com.intel.drl.spec_ref
+     * Creates a new <code>DHGenParameterSpec</code> instance with the specified
+     * parameters.
+     *
+     * @param primeSize
+     *            the size of the <i>prime modulus</i> in bits.
+     * @param exponentSize
+     *            the size of the <i>random exponent</i> in bits.
      */
     public DHGenParameterSpec(int primeSize, int exponentSize) {
         this.primeSize = primeSize;
@@ -41,14 +48,18 @@
     }
 
     /**
-     * @com.intel.drl.spec_ref
+     * Returns the size of the <i>prime modulus</i> in bits.
+     *
+     * @return the size of the prime modulus in bits.
      */
     public int getPrimeSize() {
         return primeSize;
     }
 
     /**
-     * @com.intel.drl.spec_ref
+     * Returns the size of the <i>random exponent</i> in bits.
+     *
+     * @return the size of the random exponent in bits.
      */
     public int getExponentSize() {
         return exponentSize;

Modified: harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/javax/crypto/spec/DHParameterSpec.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/javax/crypto/spec/DHParameterSpec.java?rev=767909&r1=767908&r2=767909&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/javax/crypto/spec/DHParameterSpec.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/javax/crypto/spec/DHParameterSpec.java
Thu Apr 23 12:57:17 2009
@@ -26,7 +26,7 @@
 import java.security.spec.AlgorithmParameterSpec;
 
 /**
- * @com.intel.drl.spec_ref
+ * The algorithm parameter specification for the Diffie-Hellman algorithm.
  */
 public class DHParameterSpec implements AlgorithmParameterSpec {
 
@@ -35,7 +35,13 @@
     private final int l;
 
     /**
-     * @com.intel.drl.spec_ref
+     * Creates a new <code>DHParameterSpec</code> instance with the specified
+     * <i>prime modulus</i> and <i>base generator</i>.
+     *
+     * @param p
+     *            the prime modulus.
+     * @param g
+     *            the base generator.
      */
     public DHParameterSpec(BigInteger p, BigInteger g) {
         this.p = p;
@@ -44,7 +50,16 @@
     }
 
     /**
-     * @com.intel.drl.spec_ref
+     * Creates a new <code>DHParameterSpec</code> instance with the specified
+     * <i>prime modulus</i>, <i>base generator</i> and size (in bits)
of the
+     * <i>random exponent</i>.
+     *
+     * @param p
+     *            the prime modulus.
+     * @param g
+     *            the base generator.
+     * @param l
+     *            the size of the random exponent (in bits).
      */
     public DHParameterSpec(BigInteger p, BigInteger g, int l) {
         this.p = p;
@@ -53,21 +68,27 @@
     }
 
     /**
-     * @com.intel.drl.spec_ref
+     * Returns the <i>prime modulus</i> of this parameter specification.
+     *
+     * @return the prime modulus.
      */
     public BigInteger getP() {
         return p;
     }
 
     /**
-     * @com.intel.drl.spec_ref
+     * Returns the <i>base generator</i> of this parameter specification.
+     *
+     * @return the base generator.
      */
     public BigInteger getG() {
         return g;
     }
 
     /**
-     * @com.intel.drl.spec_ref
+     * Returns the size (in bits) of the <i>random exponent</i>.
+     *
+     * @return the size (in bits) of the random exponent.
      */
     public int getL() {
         return l;

Modified: harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/javax/crypto/spec/DHPrivateKeySpec.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/javax/crypto/spec/DHPrivateKeySpec.java?rev=767909&r1=767908&r2=767909&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/javax/crypto/spec/DHPrivateKeySpec.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/javax/crypto/spec/DHPrivateKeySpec.java
Thu Apr 23 12:57:17 2009
@@ -26,7 +26,7 @@
 import java.security.spec.KeySpec;
 
 /**
- * @com.intel.drl.spec_ref
+ * The key specification for a Diffie-Hellman private key.
  */
 public class DHPrivateKeySpec implements KeySpec {
 
@@ -35,7 +35,16 @@
     private final BigInteger g;
 
     /**
-     * @com.intel.drl.spec_ref
+     * Creates a new <code>DHPrivateKeySpec</code> with the specified <i>private
+     * value</i> <code>x</code>. <i>prime modulus</i> <code>p</code>
and <i>base
+     * generator</i> <code>g</code>.
+     *
+     * @param x
+     *            the private value.
+     * @param p
+     *            the prime modulus.
+     * @param g
+     *            the base generator.
      */
     public DHPrivateKeySpec(BigInteger x, BigInteger p, BigInteger g) {
         this.x = x;
@@ -44,21 +53,27 @@
     }
 
     /**
-     * @com.intel.drl.spec_ref
+     * Returns the <i>private value</i> <code>x</code>.
+     *
+     * @return the private value <code>x</code>.
      */
     public BigInteger getX() {
         return x;
     }
 
     /**
-     * @com.intel.drl.spec_ref
+     * Returns the <i>prime modulus</i> <code>p</code>.
+     *
+     * @return the prime modulus <code>p</code>.
      */
     public BigInteger getP() {
         return p;
     }
 
     /**
-     * @com.intel.drl.spec_ref
+     * Returns the <i>base generator</i> <code>g</code>.
+     *
+     * @return the base generator <code>g</code>.
      */
     public BigInteger getG() {
         return g;

Modified: harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/javax/crypto/spec/DHPublicKeySpec.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/javax/crypto/spec/DHPublicKeySpec.java?rev=767909&r1=767908&r2=767909&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/javax/crypto/spec/DHPublicKeySpec.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/javax/crypto/spec/DHPublicKeySpec.java
Thu Apr 23 12:57:17 2009
@@ -26,7 +26,7 @@
 import java.security.spec.KeySpec;
 
 /**
- * @com.intel.drl.spec_ref
+ * The key specification for a Diffie-Hellman public key.
  */
 public class DHPublicKeySpec implements KeySpec {
 
@@ -35,7 +35,16 @@
     private final BigInteger g;
 
     /**
-     * @com.intel.drl.spec_ref
+     * Creates a new <code>DHPublicKeySpec</code> instance with the specified
+     * <i>public value</i> <code>y</code>, the <i>prime modulus</i>
+     * <code>p</code> and the <i>base generator</i> <code>g</code>.
+     *
+     * @param y
+     *            the public value.
+     * @param p
+     *            the prime modulus.
+     * @param g
+     *            the base generator.
      */
     public DHPublicKeySpec(BigInteger y, BigInteger p, BigInteger g) {
         this.y = y;
@@ -44,21 +53,27 @@
     }
 
     /**
-     * @com.intel.drl.spec_ref
+     * Returns the <i>public value</i> <code>y</code>.
+     *
+     * @return the public value <code>y</code>.
      */
     public BigInteger getY() {
         return y;
     }
 
     /**
-     * @com.intel.drl.spec_ref
+     * Returns the <i>prime modulus</i> <code>p</code>.
+     *
+     * @return the prime modulus <code>p</code>.
      */
     public BigInteger getP() {
         return p;
     }
 
     /**
-     * @com.intel.drl.spec_ref
+     * Returns the <i>base generator</i> <code>g</code>;
+     *
+     * @return the base generator <code>g</code>;
      */
     public BigInteger getG() {
         return g;

Modified: harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/javax/crypto/spec/IvParameterSpec.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/javax/crypto/spec/IvParameterSpec.java?rev=767909&r1=767908&r2=767909&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/javax/crypto/spec/IvParameterSpec.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/javax/crypto/spec/IvParameterSpec.java
Thu Apr 23 12:57:17 2009
@@ -26,14 +26,20 @@
 import org.apache.harmony.crypto.internal.nls.Messages;
 
 /**
- * @com.intel.drl.spec_ref
+ * The algorithm parameter specification for an <i>initialization vector</i>.
  */
 public class IvParameterSpec implements AlgorithmParameterSpec {
 
     private final byte[] iv;
 
     /**
-     * @com.intel.drl.spec_ref
+     * Creates a new <code>IvParameterSpec</code> instance with the bytes from
+     * the specified buffer <i>iv</i> used as <i>initialization vector</i>.
+     *
+     * @param iv
+     *            the buffer used as initialization vector.
+     * @throws NullPointerException
+     *             if the specified buffer is null.
      */
     public IvParameterSpec(byte[] iv) {
         if (iv == null) {
@@ -44,7 +50,22 @@
     }
 
     /**
-     * @com.intel.drl.spec_ref
+     * Creates a new <code>IvParameterSpec</code> instance with <code>len</code>
+     * bytes from the specified buffer <code>iv</code> starting at
+     * <code>offset</code>.
+     *
+     * @param iv
+     *            the buffer used as initialization vector.
+     * @param offset
+     *            the offset to start in the buffer.
+     * @param len
+     *            the length of the data.
+     * @throws IllegalArgumentException
+     *             if the specified buffer is null or <code>offset</code> and
+     *             <code>len</code> do not specify a valid chunk in the
+     *             specified buffer.
+     * @throws ArrayIndexOutOfBoundsException
+     *             if <code>offset</code> or <code>len</code> are
negative.
      */
     public IvParameterSpec(byte[] iv, int offset, int len) {
         if ((iv == null) || (iv.length - offset < len)) {
@@ -59,7 +80,9 @@
     }
 
     /**
-     * @com.intel.drl.spec_ref
+     * Returns a copy of the <i>initialization vector</i> data.
+     *
+     * @return a copy of the initialization vector data.
      */
     public byte[] getIV() {
         byte[] res = new byte[iv.length];

Modified: harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/javax/crypto/spec/OAEPParameterSpec.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/javax/crypto/spec/OAEPParameterSpec.java?rev=767909&r1=767908&r2=767909&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/javax/crypto/spec/OAEPParameterSpec.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/javax/crypto/spec/OAEPParameterSpec.java
Thu Apr 23 12:57:17 2009
@@ -27,7 +27,10 @@
 import javax.crypto.spec.PSource;
 
 /**
- * @com.intel.drl.spec_ref
+ * The algorithm parameter specification for the <i>OAEP Padding</i> algorithm.
+ * <p>
+ * This padding algorithm is defined in the <a
+ * href="http://www.ietf.org/rfc/rfc3447.txt">PKCS #1</a> standard.
  */
 public class OAEPParameterSpec implements AlgorithmParameterSpec {
 
@@ -37,7 +40,14 @@
     private final PSource pSrc;
 
     /**
-     * @com.intel.drl.spec_ref
+     * The algorithm parameter instance with default values.
+     * <p>
+     * It uses the following parameters:
+     * <ul><li>message digest : <code>"SHA-1"</code></li>
+     * <li>mask generation function (<i>mgf</i>) : <code>"MGF1"</code></li>
+     * <li>parameters for the <i>mgf</i> : "SHA-1" {@link MGF1ParameterSpec#SHA1}</li>
+     * <li>the source of the label <code>L</code>: {@link PSource.PSpecified#DEFAULT}</li>
+     * </ul>
      */
     public static final OAEPParameterSpec DEFAULT = new OAEPParameterSpec();
 
@@ -49,7 +59,23 @@
     }
 
     /**
-     * @com.intel.drl.spec_ref
+     * Creates a new <code>OAEPParameterSpec</code> instance with the specified
+     * <i>message digest</i> algorithm name, <i>mask generation function</i>
+     * (<i>mgf</i>) algorithm name, <i>parameters</i> for the <i>mgf</i>
+     * algorithm and the <i>source of the label <code>L</code></i>.
+     *
+     * @param mdName
+     *            the message digest algorithm name.
+     * @param mgfName
+     *            the mask generation function algorithm name.
+     * @param mgfSpec
+     *            the algorithm parameter specification for the mask generation
+     *            function algorithm.
+     * @param pSrc
+     *            the source of the label <code>L</code>.
+     * @throws NullPointerException
+     *             if one of <code>mdName</code>, <code>mgfName</code>
or
+     *             <code>pSrc</code> is null.
      */
     public OAEPParameterSpec(String mdName, String mgfName,
                                 AlgorithmParameterSpec mgfSpec, PSource pSrc) {
@@ -63,28 +89,38 @@
     }
 
     /**
-     * @com.intel.drl.spec_ref
+     * Returns the algorithm name of the <i>message digest</i>.
+     *
+     * @return the algorithm name of the message digest.
      */
     public String getDigestAlgorithm() {
         return mdName;
     }
 
     /**
-     * @com.intel.drl.spec_ref
+     * Returns the algorithm name of the <i>mask generation function</i>.
+     *
+     * @return the algorithm name of the mask generation function.
      */
     public String getMGFAlgorithm() {
         return mgfName;
     }
 
     /**
-     * @com.intel.drl.spec_ref
+     * Returns the algorithm parameter specification for the mask generation
+     * function algorithm.
+     *
+     * @return the algorithm parameter specification for the mask generation
+     *         function algorithm.
      */
     public AlgorithmParameterSpec getMGFParameters() {
         return mgfSpec;
     }
 
     /**
-     * @com.intel.drl.spec_ref
+     * Returns the source of the label <code>L</code>.
+     *
+     * @return the source of the label <code>L</code>.
      */
     public PSource getPSource() {
         return pSrc;

Modified: harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/javax/crypto/spec/PBEKeySpec.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/javax/crypto/spec/PBEKeySpec.java?rev=767909&r1=767908&r2=767909&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/javax/crypto/spec/PBEKeySpec.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/javax/crypto/spec/PBEKeySpec.java
Thu Apr 23 12:57:17 2009
@@ -28,7 +28,10 @@
 import org.apache.harmony.crypto.internal.nls.Messages;
 
 /**
- * @com.intel.drl.spec_ref
+ * The key specification for a <i>password based encryption</i> key.
+ * <p>
+ * Password based encryption is described in <a
+ * href="http://www.ietf.org/rfc/rfc2898.txt">PKCS #5</a>.
  */
 public class PBEKeySpec implements KeySpec {
 
@@ -38,7 +41,10 @@
     private final int keyLength;
 
     /**
-     * @com.intel.drl.spec_ref
+     * Creates a new <code>PBEKeySpec</code> with the specified password.
+     *
+     * @param password
+     *            the password.
      */
     public PBEKeySpec(char[] password) {
         if (password == null) {
@@ -53,7 +59,22 @@
     }
 
     /**
-     * @com.intel.drl.spec_ref
+     * Creates a new <code>PBEKeySpec</code> with the specified password, salt,
+     * iteration count and the desired length of the derived key.
+     *
+     * @param password
+     *            the password.
+     * @param salt
+     *            the salt.
+     * @param iterationCount
+     *            the iteration count.
+     * @param keyLength
+     *            the desired key length of the derived key,
+     * @throws NullPointerException
+     *             if the salt is null.
+     * @throws IllegalArgumentException
+     *             if the salt is empty, iteration count is zero or negative or
+     *             the key length is zero or negative.
      */
     public PBEKeySpec(char[] password, byte[] salt, int iterationCount,
                       int keyLength) {
@@ -84,7 +105,19 @@
     }
 
     /**
-     * @com.intel.drl.spec_ref
+     * Creates a new <code>PBEKeySpec</code> with the specified password, salt
+     * and iteration count.
+     *
+     * @param password
+     *            the password.
+     * @param salt
+     *            the salt.
+     * @param iterationCount
+     *            the iteration count.
+     * @throws NullPointerException
+     *             if salt is null.
+     * @throws IllegalArgumentException
+     *             if the salt is empty or iteration count is zero or negative.
      */
     public PBEKeySpec(char[] password, byte[] salt, int iterationCount) {
         if (salt == null) {
@@ -111,7 +144,7 @@
     }
 
     /**
-     * @com.intel.drl.spec_ref
+     * Clears the password by overwriting it.
      */
     public final void clearPassword() {
         Arrays.fill(password, '?');
@@ -119,7 +152,11 @@
     }
 
     /**
-     * @com.intel.drl.spec_ref
+     * Returns a copy of the password of this key specification.
+     *
+     * @return a copy of the password of this key specification.
+     * @throws IllegalStateException
+     *             if the password has been cleared before.
      */
     public final char[] getPassword() {
         if (password == null) {
@@ -131,7 +168,10 @@
     }
 
     /**
-     * @com.intel.drl.spec_ref
+     * Returns a copy of the salt of this key specification.
+     *
+     * @return a copy of the salt of this key specification or null if none is
+     *         specified.
      */
     public final byte[] getSalt() {
         if (salt == null) {
@@ -143,14 +183,18 @@
     }
 
     /**
-     * @com.intel.drl.spec_ref
+     * Returns the iteration count of this key specification.
+     *
+     * @return the iteration count of this key specification.
      */
     public final int getIterationCount() {
         return iterationCount;
     }
 
     /**
-     * @com.intel.drl.spec_ref
+     * Returns the desired key length of the derived key.
+     *
+     * @return the desired key length of the derived key.
      */
     public final int getKeyLength() {
         return keyLength;

Modified: harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/javax/crypto/spec/PBEParameterSpec.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/javax/crypto/spec/PBEParameterSpec.java?rev=767909&r1=767908&r2=767909&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/javax/crypto/spec/PBEParameterSpec.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/javax/crypto/spec/PBEParameterSpec.java
Thu Apr 23 12:57:17 2009
@@ -27,7 +27,12 @@
 import org.apache.harmony.crypto.internal.nls.Messages;
 
 /**
- * @com.intel.drl.spec_ref
+ * The algorithm parameter specification for a <i>password based encryption</i>
+ * algorithm.
+ * <p>
+ * Password based encryption is described in <a
+ * href="http://www.ietf.org/rfc/rfc2898.txt">PKCS #5</a>.
+ *
  */
 public class PBEParameterSpec implements AlgorithmParameterSpec {
 
@@ -35,7 +40,15 @@
     private final int iterationCount;
 
     /**
-     * @com.intel.drl.spec_ref
+     * Creates a new <code>PBEParameterSpec</code> with the specified salt and
+     * iteration count.
+     *
+     * @param salt
+     *            the salt.
+     * @param iterationCount
+     *            the iteration count.
+     * @throws NullPointerException
+     *             if salt is null.
      */
     public PBEParameterSpec(byte[] salt, int iterationCount) {
         if (salt == null) {
@@ -47,7 +60,9 @@
     }
 
     /**
-     * @com.intel.drl.spec_ref
+     * Returns a copy to the salt.
+     *
+     * @return a copy to the salt.
      */
     public byte[] getSalt() {
         byte[] result = new byte[salt.length];
@@ -56,7 +71,9 @@
     }
 
     /**
-     * @com.intel.drl.spec_ref
+     * Returns the iteration count.
+     *
+     * @return the iteration count.
      */
     public int getIterationCount() {
         return iterationCount;

Modified: harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/javax/crypto/spec/PSource.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/javax/crypto/spec/PSource.java?rev=767909&r1=767908&r2=767909&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/javax/crypto/spec/PSource.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/javax/crypto/spec/PSource.java
Thu Apr 23 12:57:17 2009
@@ -25,7 +25,8 @@
 import org.apache.harmony.crypto.internal.nls.Messages;
 
 /**
- * @com.intel.drl.spec_ref
+ * The source of the label <code>L</code> as specified in <a
+ * href="http://www.ietf.org/rfc/rfc3447.txt"> PKCS #1</a>.
  */
 public class PSource {
 
@@ -34,7 +35,13 @@
     private PSource() {}
 
     /**
-     * @com.intel.drl.spec_ref
+     * Creates a new <code>PSource</code> instance with the specified source
+     * algorithm identifier.
+     *
+     * @param pSrcName
+     *            the source algorithm identifier.
+     * @throws NullPointerException
+     *             if pSrcName is null.
      */
     protected PSource(String pSrcName) {
         if (pSrcName == null) {
@@ -44,21 +51,25 @@
     }
 
     /**
-     * @com.intel.drl.spec_ref
+     * Returns the source algorithm identifier.
+     *
+     * @return the source algorithm identifier.
      */
     public String getAlgorithm() {
         return pSrcName;
     }
 
     /**
-     * @com.intel.drl.spec_ref
+     * The explicit specification of the parameter <code>P</code> used in the
+     * source algorithm.
      */
     public static final class PSpecified extends PSource {
 
         private final byte[] p;
 
         /**
-         * @com.intel.drl.spec_ref
+         * The instance of <code>PSpecified</code> with the default value
+         * <code>byte[0]</code> for <code>P</code>
          */
         public static final PSpecified DEFAULT = new PSpecified();
 
@@ -68,7 +79,13 @@
         }
 
         /**
-         * @com.intel.drl.spec_ref
+         * Creates a new instance of <code>PSpecified</code> with the specified
+         * parameter <code>P</code>.
+         *
+         * @param p
+         *            the parameter <code>P</code>.
+         * @throws NullPointerException
+         *             if <code>p</code> is null.
          */
         public PSpecified(byte[] p) {
             super("PSpecified"); //$NON-NLS-1$
@@ -82,7 +99,9 @@
         }
 
         /**
-         * @com.intel.drl.spec_ref
+         * Returns a copy of the value of the parameter <code>P</code>.
+         *
+         * @return a copy of the value of the parameter <code>P</code>
          */
         public byte[] getValue() {
             byte[] result = new byte[p.length];

Modified: harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/javax/crypto/spec/RC2ParameterSpec.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/javax/crypto/spec/RC2ParameterSpec.java?rev=767909&r1=767908&r2=767909&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/javax/crypto/spec/RC2ParameterSpec.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/javax/crypto/spec/RC2ParameterSpec.java
Thu Apr 23 12:57:17 2009
@@ -28,7 +28,8 @@
 import org.apache.harmony.crypto.internal.nls.Messages;
 
 /**
- * @com.intel.drl.spec_ref
+ * The algorithm parameter specification for the <a
+ * href="http://www.ietf.org/rfc/rfc2268.txt">RC2</a> algorithm.
  */
 public class RC2ParameterSpec implements AlgorithmParameterSpec {
 
@@ -36,7 +37,11 @@
     private final byte[] iv;
 
     /**
-     * @com.intel.drl.spec_ref
+     * Creates a new <code>RC2ParameterSpec</code> instance with the specified
+     * effective key length (in bits),
+     *
+     * @param effectiveKeyBits
+     *            the effective key length (in bits).
      */
     public RC2ParameterSpec(int effectiveKeyBits) {
         this.effectiveKeyBits = effectiveKeyBits;
@@ -44,7 +49,18 @@
     }
 
     /**
-     * @com.intel.drl.spec_ref
+     * Creates a new <code>RC2ParameterSpec</code> instance with the specified
+     * effective key length (in bits) and <i>initialization vector</i>.
+     * <p>
+     * The size of the <i>initialization vector</i> must be at least 8 bytes
+     * which are copied to protect them against modification.
+     *
+     * @param effectiveKeyBits
+     *            the effective key length (in bits).
+     * @param iv
+     *            the initialization vector.
+     * @throws IllegalArgumentException
+     *             if the initialization vector is null or shorter than 8 bytes.
      */
     public RC2ParameterSpec(int effectiveKeyBits, byte[] iv) {
         if (iv == null) {
@@ -59,7 +75,22 @@
     }
 
     /**
-     * @com.intel.drl.spec_ref
+     * Creates a new <code>RC2ParameterSpec</code> instance with the specified
+     * effective key length (in bits) and <i>initialization vector<i>.
+     * <p>
+     * The size of the <i>initialization vector</i> starting at
+     * <code>offset</code> must be at least 8 bytes which are copied to protect
+     * them against modification.
+     *
+     * @param effectiveKeyBits
+     *            the effective key length (in bits).
+     * @param iv
+     *            the initialization vector.
+     * @param offset
+     *            the offset in the initialization vector to start at.
+     * @throws IllegalArgumentException
+     *             if the initialization vector is null or starting at
+     *             <code>offset</code> is shorter than 8 bytes.
      */
     public RC2ParameterSpec(int effectiveKeyBits, byte[] iv, int offset) {
         if (iv == null) {
@@ -74,14 +105,18 @@
     }
 
     /**
-     * @com.intel.drl.spec_ref
+     * Returns the effective key length (in bits).
+     *
+     * @return the effective key length (in bits).
      */
     public int getEffectiveKeyBits() {
         return effectiveKeyBits;
     }
 
     /**
-     * @com.intel.drl.spec_ref
+     * Returns a copy of the initialization vector.
+     *
+     * @return a copy of the initialization vector, or null if none specified.
      */
     public byte[] getIV() {
         if (iv == null) {
@@ -93,7 +128,13 @@
     }
 
     /**
-     * @com.intel.drl.spec_ref
+     * Compares the specified object to this <code>RC2ParameterSpec</code>
+     * instance.
+     *
+     * @param obj
+     *            the object to compare.
+     * @return true if the effective key length and the initialization vector of
+     *         both objects are equal, otherwise false.
      */
     @Override
     public boolean equals(Object obj) {
@@ -109,7 +150,9 @@
     }
 
     /**
-     * @com.intel.drl.spec_ref
+     * Returns the hash code of this <code>RC2ParameterSpec</code> instance.
+     *
+     * @return the hash code.
      */
     @Override
     public int hashCode() {

Modified: harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/javax/crypto/spec/RC5ParameterSpec.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/javax/crypto/spec/RC5ParameterSpec.java?rev=767909&r1=767908&r2=767909&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/javax/crypto/spec/RC5ParameterSpec.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/javax/crypto/spec/RC5ParameterSpec.java
Thu Apr 23 12:57:17 2009
@@ -28,7 +28,8 @@
 import org.apache.harmony.crypto.internal.nls.Messages;
 
 /**
- * @com.intel.drl.spec_ref
+ * The algorithm parameter specification for the <a
+ * href="http://www.ietf.org/rfc/rfc2040.txt">RC5</a> algorithm.
  */
 public class RC5ParameterSpec implements AlgorithmParameterSpec {
 
@@ -38,7 +39,15 @@
     private final byte[] iv;
 
     /**
-     * @com.intel.drl.spec_ref
+     * Creates a new <code>RC5ParameterSpec</code> instance with the specified
+     * version, round count an word size (in bits).
+     *
+     * @param version
+     *            the version.
+     * @param rounds
+     *            the round count.
+     * @param wordSize
+     *            the word size (in bits).
      */
     public RC5ParameterSpec(int version, int rounds, int wordSize) {
         this.version = version;
@@ -48,7 +57,25 @@
     }
 
     /**
-     * @com.intel.drl.spec_ref
+     * Creates a new <code>RC5ParameterSpec</code> instance with the specified
+     * version, round count, word size (in bits) and an <i>initialization
+     * vector</i>.
+     * <p>
+     * The size of the <i>initialization vector</i> must be at least
+     * <code>2 * (wordSize / 8)</code> bytes which are copied to protect them
+     * against modification.
+     *
+     * @param version
+     *            the version.
+     * @param rounds
+     *            the round count.
+     * @param wordSize
+     *            the word size (in bits).
+     * @param iv
+     *            the initialization vector.
+     * @throws IllegalArgumentException
+     *             if the initialization vector is null or shorter than <code>2
+     *             * (wordSize / 8)</code>.
      */
     public RC5ParameterSpec(int version, int rounds, int wordSize, byte[] iv) {
         if (iv == null) {
@@ -66,7 +93,29 @@
     }
 
     /**
-     * @com.intel.drl.spec_ref
+     * Creates a new <code>RC5ParameterSpec</code> instance with the specified
+     * version, round count, wordSize (in bits), an <i>initialization vector</i>
+     * and an offset.
+     * <p>
+     * The size of the <i>initialization vector</i> must be at least
+     * <code>offset + (2 * (wordSize / 8))</code> bytes. The bytes starting at
+     * <code>offset</code> are copied to protect them against modification.
+     *
+     * @param version
+     *            the version.
+     * @param rounds
+     *            the round count.
+     * @param wordSize
+     *            the word size (in bits).
+     * @param iv
+     *            the initialization vector.
+     * @param offset
+     *            the offset in the initialization vector.
+     * @throws IllegalArgumentException
+     *             if the initialization vector is null of shorter than
+     *             <code>offset + (2 * (wordSize / 8))</code>.
+     * @throws ArrayIndexOutOfBoundsException
+     *             if <code>offset</code> is negative.
      */
     public RC5ParameterSpec(int version, int rounds,
                                 int wordSize, byte[] iv, int offset) {
@@ -88,28 +137,36 @@
     }
 
     /**
-     * @com.intel.drl.spec_ref
+     * Returns the version.
+     *
+     * @return the version.
      */
     public int getVersion() {
         return version;
     }
 
     /**
-     * @com.intel.drl.spec_ref
+     * Returns the round count.
+     *
+     * @return the round count.
      */
     public int getRounds() {
         return rounds;
     }
 
     /**
-     * @com.intel.drl.spec_ref
+     * Returns the word size (in bits).
+     *
+     * @return the word size (in bits).
      */
     public int getWordSize() {
         return wordSize;
     }
 
     /**
-     * @com.intel.drl.spec_ref
+     * Returns a copy of the initialization vector.
+     *
+     * @return a copy of the initialization vector, or null if none specified.
      */
     public byte[] getIV() {
         if (iv == null) {
@@ -121,7 +178,13 @@
     }
 
     /**
-     * @com.intel.drl.spec_ref
+     * Compares the specified object with this <code>RC5ParameterSpec</code>
+     * instance.
+     *
+     * @param obj
+     *            the object to compare.
+     * @return true if version, round count, word size and initializaion vector
+     *         of both objects are equal, otherwise false.
      */
     @Override
     public boolean equals(Object obj) {
@@ -139,7 +202,9 @@
     }
 
     /**
-     * @com.intel.drl.spec_ref
+     * Returns the hash code of this <code>RC5ParameterSpec</code> instance.
+     *
+     * @return the hash code.
      */
     @Override
     public int hashCode() {

Modified: harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/javax/crypto/spec/SecretKeySpec.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/javax/crypto/spec/SecretKeySpec.java?rev=767909&r1=767908&r2=767909&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/javax/crypto/spec/SecretKeySpec.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/javax/crypto/spec/SecretKeySpec.java
Thu Apr 23 12:57:17 2009
@@ -30,7 +30,9 @@
 import org.apache.harmony.crypto.internal.nls.Messages;
 
 /**
- * @com.intel.drl.spec_ref
+ * A key specification for a <code>SecretKey</code> and also a secret key
+ * implementation that is provider-independent. It can be used for raw secret
+ * keys that can be specified as <code>byte[]</code>.
  */
 public class SecretKeySpec implements SecretKey, KeySpec, Serializable {
 
@@ -44,15 +46,24 @@
     private final String format = "RAW"; //$NON-NLS-1$
 
     /**
-     * @com.intel.drl.spec_ref
+     * Creates a new <code>SecretKeySpec</code> for the specified key data and
+     * algorithm name.
+     *
+     * @param key
+     *            the key data.
+     * @param algorithm
+     *            the algorithm name.
+     * @throws IllegalArgumentException
+     *             if the key data or the algorithm name is null or if the key
+     *             data is empty.
      */
     public SecretKeySpec(byte[] key, String algorithm) {
-    	if (key == null) {
-    		throw new IllegalArgumentException(Messages.getString("crypto.05")); //$NON-NLS-1$
-    	}
-    	if (key.length == 0) {
-    		throw new IllegalArgumentException(Messages.getString("crypto.35")); //$NON-NLS-1$
-    	}
+        if (key == null) {
+            throw new IllegalArgumentException(Messages.getString("crypto.05")); //$NON-NLS-1$
+        }
+        if (key.length == 0) {
+            throw new IllegalArgumentException(Messages.getString("crypto.35")); //$NON-NLS-1$
+        }
         if (algorithm == null) {
             throw new IllegalArgumentException(Messages.getString("crypto.02")); //$NON-NLS-1$
         }
@@ -63,21 +74,38 @@
     }
 
     /**
-     * @com.intel.drl.spec_ref
+     * Creates a new <code>SecretKeySpec</code> for the key data from the
+     * specified buffer <code>key</code> starting at <code>offset</code>
with
+     * length <code>len</code> and the specified <code>algorithm</code>
name.
+     *
+     * @param key
+     *            the key data.
+     * @param offset
+     *            the offset.
+     * @param len
+     *            the size of the key data.
+     * @param algorithm
+     *            the algorithm name.
+     * @throws IllegalArgumentException
+     *             if the key data or the algorithm name is null, the key data
+     *             is empty or <code>offset</code> and <code>len</code>
do not
+     *             specify a valid chunk in the buffer <code>key</code>.
+     * @throws ArrayIndexOutOfBoundsException
+     *             if <code>offset</code> or <code>len</code> is
negative.
      */
     public SecretKeySpec(byte[] key, int offset, int len, String algorithm) {
-    	if (key == null) {
-    		throw new IllegalArgumentException(Messages.getString("crypto.05")); //$NON-NLS-1$
-    	}
-    	if (key.length == 0) {
-    		throw new IllegalArgumentException(Messages.getString("crypto.35")); //$NON-NLS-1$
-    	}
+        if (key == null) {
+            throw new IllegalArgumentException(Messages.getString("crypto.05")); //$NON-NLS-1$
+        }
+        if (key.length == 0) {
+            throw new IllegalArgumentException(Messages.getString("crypto.35")); //$NON-NLS-1$
+        }
         if (len < 0) {
             throw new ArrayIndexOutOfBoundsException(Messages.getString("crypto.36")); //$NON-NLS-1$
         }
-    	if ((key.length - offset < len)) {
-    		throw new IllegalArgumentException(Messages.getString("crypto.37")); //$NON-NLS-1$
-    	}
+        if ((key.length - offset < len)) {
+            throw new IllegalArgumentException(Messages.getString("crypto.37")); //$NON-NLS-1$
+        }
         if (algorithm == null) {
             throw new IllegalArgumentException(Messages.getString("crypto.02")); //$NON-NLS-1$
         }
@@ -87,21 +115,27 @@
     }
 
     /**
-     * @com.intel.drl.spec_ref
+     * Returns the algorithm name.
+     *
+     * @return the algorithm name.
      */
     public String getAlgorithm() {
         return algorithm;
     }
 
     /**
-     * @com.intel.drl.spec_ref
+     * Returns the name of the format used to encode the key.
+     *
+     * @return the format name "RAW".
      */
     public String getFormat() {
         return format;
     }
 
     /**
-     * @com.intel.drl.spec_ref
+     * Returns the encoded form of this secret key.
+     *
+     * @return the encoded form of this secret key.
      */
     public byte[] getEncoded() {
         byte[] result = new byte[key.length];
@@ -110,7 +144,9 @@
     }
 
     /**
-     * @com.intel.drl.spec_ref
+     * Returns the hash code of this <code>SecretKeySpec</code> object.
+     *
+     * @return the hash code.
      */
     @Override
     public int hashCode() {
@@ -122,7 +158,13 @@
     }
 
     /**
-     * @com.intel.drl.spec_ref
+     * Compares the specified object with this <code>SecretKeySpec</code>
+     * instance.
+     *
+     * @param obj
+     *            the object to compare.
+     * @return true if the algorithm name and key of both object are equal,
+     *         otherwise false.
      */
     @Override
     public boolean equals(Object obj) {



Mime
View raw message