Return-Path: Delivered-To: apmail-harmony-commits-archive@www.apache.org Received: (qmail 44361 invoked from network); 23 Apr 2009 12:57:56 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 23 Apr 2009 12:57:56 -0000 Received: (qmail 17506 invoked by uid 500); 23 Apr 2009 12:57:56 -0000 Delivered-To: apmail-harmony-commits-archive@harmony.apache.org Received: (qmail 17483 invoked by uid 500); 23 Apr 2009 12:57:56 -0000 Mailing-List: contact commits-help@harmony.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@harmony.apache.org Delivered-To: mailing list commits@harmony.apache.org Received: (qmail 17474 invoked by uid 99); 23 Apr 2009 12:57:56 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 23 Apr 2009 12:57:56 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 23 Apr 2009 12:57:42 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id B15A32388B95; Thu, 23 Apr 2009 12:57:20 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit 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 -0000 To: commits@harmony.apache.org From: tellison@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20090423125720.B15A32388B95@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org 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 DESKeySpec 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 DESKeySpec from the first 8 bytes of the + * specified key data starting at offset. + * + * @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 offset is + * parity-adjusted. + * + * @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 offset 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 DESedeKeySpec 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 DESedeKeySpec instance from the first 24 ( + * {@link #DES_EDE_KEY_LEN} ) bytes of the specified key data starting at + * offset. + * + * @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 offset is + * parity-adjusted. + * + * @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 DHGenParameterSpec instance with the specified + * parameters. + * + * @param primeSize + * the size of the prime modulus in bits. + * @param exponentSize + * the size of the random exponent 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 prime modulus 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 random exponent 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 DHParameterSpec instance with the specified + * prime modulus and base generator. + * + * @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 DHParameterSpec instance with the specified + * prime modulus, base generator and size (in bits) of the + * random exponent. + * + * @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 prime modulus of this parameter specification. + * + * @return the prime modulus. */ public BigInteger getP() { return p; } /** - * @com.intel.drl.spec_ref + * Returns the base generator 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 random exponent. + * + * @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 DHPrivateKeySpec with the specified private + * value x. prime modulus p and base + * generator g. + * + * @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 private value x. + * + * @return the private value x. */ public BigInteger getX() { return x; } /** - * @com.intel.drl.spec_ref + * Returns the prime modulus p. + * + * @return the prime modulus p. */ public BigInteger getP() { return p; } /** - * @com.intel.drl.spec_ref + * Returns the base generator g. + * + * @return the base generator g. */ 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 DHPublicKeySpec instance with the specified + * public value y, the prime modulus + * p and the base generator g. + * + * @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 public value y. + * + * @return the public value y. */ public BigInteger getY() { return y; } /** - * @com.intel.drl.spec_ref + * Returns the prime modulus p. + * + * @return the prime modulus p. */ public BigInteger getP() { return p; } /** - * @com.intel.drl.spec_ref + * Returns the base generator g; + * + * @return the base generator g; */ 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 initialization vector. */ public class IvParameterSpec implements AlgorithmParameterSpec { private final byte[] iv; /** - * @com.intel.drl.spec_ref + * Creates a new IvParameterSpec instance with the bytes from + * the specified buffer iv used as initialization vector. + * + * @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 IvParameterSpec instance with len + * bytes from the specified buffer iv starting at + * offset. + * + * @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 offset and + * len do not specify a valid chunk in the + * specified buffer. + * @throws ArrayIndexOutOfBoundsException + * if offset or len 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 initialization vector 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 OAEP Padding algorithm. + *

+ * This padding algorithm is defined in the PKCS #1 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. + *

+ * It uses the following parameters: + *

  • message digest : "SHA-1"
  • + *
  • mask generation function (mgf) : "MGF1"
  • + *
  • parameters for the mgf : "SHA-1" {@link MGF1ParameterSpec#SHA1}
  • + *
  • the source of the label L: {@link PSource.PSpecified#DEFAULT}
  • + *
*/ public static final OAEPParameterSpec DEFAULT = new OAEPParameterSpec(); @@ -49,7 +59,23 @@ } /** - * @com.intel.drl.spec_ref + * Creates a new OAEPParameterSpec instance with the specified + * message digest algorithm name, mask generation function + * (mgf) algorithm name, parameters for the mgf + * algorithm and the source of the label L. + * + * @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 L. + * @throws NullPointerException + * if one of mdName, mgfName or + * pSrc 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 message digest. + * + * @return the algorithm name of the message digest. */ public String getDigestAlgorithm() { return mdName; } /** - * @com.intel.drl.spec_ref + * Returns the algorithm name of the mask generation function. + * + * @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 L. + * + * @return the source of the label L. */ 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 password based encryption key. + *

+ * Password based encryption is described in PKCS #5. */ public class PBEKeySpec implements KeySpec { @@ -38,7 +41,10 @@ private final int keyLength; /** - * @com.intel.drl.spec_ref + * Creates a new PBEKeySpec 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 PBEKeySpec 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 PBEKeySpec 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 password based encryption + * algorithm. + *

+ * Password based encryption is described in PKCS #5. + * */ public class PBEParameterSpec implements AlgorithmParameterSpec { @@ -35,7 +40,15 @@ private final int iterationCount; /** - * @com.intel.drl.spec_ref + * Creates a new PBEParameterSpec 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 L as specified in PKCS #1. */ public class PSource { @@ -34,7 +35,13 @@ private PSource() {} /** - * @com.intel.drl.spec_ref + * Creates a new PSource 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 P used in the + * source algorithm. */ public static final class PSpecified extends PSource { private final byte[] p; /** - * @com.intel.drl.spec_ref + * The instance of PSpecified with the default value + * byte[0] for P */ public static final PSpecified DEFAULT = new PSpecified(); @@ -68,7 +79,13 @@ } /** - * @com.intel.drl.spec_ref + * Creates a new instance of PSpecified with the specified + * parameter P. + * + * @param p + * the parameter P. + * @throws NullPointerException + * if p 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 P. + * + * @return a copy of the value of the parameter P */ 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 RC2 algorithm. */ public class RC2ParameterSpec implements AlgorithmParameterSpec { @@ -36,7 +37,11 @@ private final byte[] iv; /** - * @com.intel.drl.spec_ref + * Creates a new RC2ParameterSpec 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 RC2ParameterSpec instance with the specified + * effective key length (in bits) and initialization vector. + *

+ * The size of the initialization vector 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 RC2ParameterSpec instance with the specified + * effective key length (in bits) and initialization vector. + *

+ * The size of the initialization vector starting at + * offset 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 + * offset 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 RC2ParameterSpec + * 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 RC2ParameterSpec 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 RC5 algorithm. */ public class RC5ParameterSpec implements AlgorithmParameterSpec { @@ -38,7 +39,15 @@ private final byte[] iv; /** - * @com.intel.drl.spec_ref + * Creates a new RC5ParameterSpec 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 RC5ParameterSpec instance with the specified + * version, round count, word size (in bits) and an initialization + * vector. + *

+ * The size of the initialization vector must be at least + * 2 * (wordSize / 8) 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 2 + * * (wordSize / 8). */ 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 RC5ParameterSpec instance with the specified + * version, round count, wordSize (in bits), an initialization vector + * and an offset. + *

+ * The size of the initialization vector must be at least + * offset + (2 * (wordSize / 8)) bytes. The bytes starting at + * offset 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 + * offset + (2 * (wordSize / 8)). + * @throws ArrayIndexOutOfBoundsException + * if offset 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 RC5ParameterSpec + * 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 RC5ParameterSpec 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 SecretKey and also a secret key + * implementation that is provider-independent. It can be used for raw secret + * keys that can be specified as byte[]. */ 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 SecretKeySpec 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 SecretKeySpec for the key data from the + * specified buffer key starting at offset with + * length len and the specified algorithm 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 offset and len do not + * specify a valid chunk in the buffer key. + * @throws ArrayIndexOutOfBoundsException + * if offset or len 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 SecretKeySpec object. + * + * @return the hash code. */ @Override public int hashCode() { @@ -122,7 +158,13 @@ } /** - * @com.intel.drl.spec_ref + * Compares the specified object with this SecretKeySpec + * 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) {