From 8207f1e8dbc63916f238f81dc46567c55090e95b Mon Sep 17 00:00:00 2001 From: Jesse Wilson Date: Mon, 31 Aug 2009 15:37:14 -0700 Subject: [PATCH] Update crypto package to Harmony r802921. Only Javadoc changes. commit d5d4307b5b9f37e6f66ab1273be1acd2a29177de Merge: 2c2287b 1c60d7c Author: Jesse Wilson Date: Mon Aug 31 15:36:46 2009 -0700 Merge branch 'crypto_802921' into crypto_dalvik Conflicts: libcore/crypto/.classpath libcore/crypto/build.xml libcore/crypto/src/main/java/javax/crypto/BadPaddingException.java libcore/crypto/src/main/java/javax/crypto/Cipher.java libcore/crypto/src/main/java/javax/crypto/CipherInputStream.java libcore/crypto/src/main/java/javax/crypto/CipherOutputStream.java libcore/crypto/src/main/java/javax/crypto/CipherSpi.java libcore/crypto/src/main/java/javax/crypto/EncryptedPrivateKeyInfo.java libcore/crypto/src/main/java/javax/crypto/ExemptionMechanism.java libcore/crypto/src/main/java/javax/crypto/ExemptionMechanismException.java libcore/crypto/src/main/java/javax/crypto/ExemptionMechanismSpi.java libcore/crypto/src/main/java/javax/crypto/IllegalBlockSizeException.java libcore/crypto/src/main/java/javax/crypto/KeyAgreement.java libcore/crypto/src/main/java/javax/crypto/KeyAgreementSpi.java libcore/crypto/src/main/java/javax/crypto/KeyGenerator.java libcore/crypto/src/main/java/javax/crypto/KeyGeneratorSpi.java libcore/crypto/src/main/java/javax/crypto/Mac.java libcore/crypto/src/main/java/javax/crypto/MacSpi.java libcore/crypto/src/main/java/javax/crypto/NoSuchPaddingException.java libcore/crypto/src/main/java/javax/crypto/NullCipher.java libcore/crypto/src/main/java/javax/crypto/SealedObject.java libcore/crypto/src/main/java/javax/crypto/SecretKey.java libcore/crypto/src/main/java/javax/crypto/SecretKeyFactory.java libcore/crypto/src/main/java/javax/crypto/SecretKeyFactorySpi.java libcore/crypto/src/main/java/javax/crypto/ShortBufferException.java libcore/crypto/src/main/java/javax/crypto/interfaces/DHKey.java libcore/crypto/src/main/java/javax/crypto/interfaces/DHPrivateKey.java libcore/crypto/src/main/java/javax/crypto/interfaces/DHPublicKey.java libcore/crypto/src/main/java/javax/crypto/interfaces/PBEKey.java libcore/crypto/src/main/java/javax/crypto/spec/DESKeySpec.java libcore/crypto/src/main/java/javax/crypto/spec/DESedeKeySpec.java libcore/crypto/src/main/java/javax/crypto/spec/DHGenParameterSpec.java libcore/crypto/src/main/java/javax/crypto/spec/DHParameterSpec.java libcore/crypto/src/main/java/javax/crypto/spec/DHPrivateKeySpec.java libcore/crypto/src/main/java/javax/crypto/spec/DHPublicKeySpec.java libcore/crypto/src/main/java/javax/crypto/spec/IvParameterSpec.java libcore/crypto/src/main/java/javax/crypto/spec/OAEPParameterSpec.java libcore/crypto/src/main/java/javax/crypto/spec/PBEKeySpec.java libcore/crypto/src/main/java/javax/crypto/spec/PBEParameterSpec.java libcore/crypto/src/main/java/javax/crypto/spec/PSource.java libcore/crypto/src/main/java/javax/crypto/spec/RC2ParameterSpec.java libcore/crypto/src/main/java/javax/crypto/spec/RC5ParameterSpec.java libcore/crypto/src/main/java/javax/crypto/spec/SecretKeySpec.java commit 2c2287b521cc5f558d9929e14e31ec92da6285b1 Author: Jesse Wilson Date: Mon Aug 31 14:56:45 2009 -0700 crypto_dalvik commit 1c60d7c222c55ae49add8345a192c54357bb4a1f Author: Jesse Wilson Date: Mon Aug 31 14:56:34 2009 -0700 crypto_802921 commit 50cf7f5d97de2f65ee0769aafec7b5a3551cb5d0 Author: Jesse Wilson Date: Mon Aug 31 14:56:27 2009 -0700 crypto_527399 --- .../java/javax/crypto/BadPaddingException.java | 5 - .../crypto/src/main/java/javax/crypto/Cipher.java | 151 ++++++--------------- .../main/java/javax/crypto/CipherInputStream.java | 42 ++---- .../main/java/javax/crypto/CipherOutputStream.java | 24 ++-- .../src/main/java/javax/crypto/CipherSpi.java | 82 ++++------- .../java/javax/crypto/EncryptedPrivateKeyInfo.java | 37 ++--- .../main/java/javax/crypto/ExemptionMechanism.java | 46 ++----- .../javax/crypto/ExemptionMechanismException.java | 5 - .../java/javax/crypto/ExemptionMechanismSpi.java | 21 +-- .../javax/crypto/IllegalBlockSizeException.java | 5 - .../src/main/java/javax/crypto/KeyAgreement.java | 43 ++---- .../main/java/javax/crypto/KeyAgreementSpi.java | 24 +--- .../src/main/java/javax/crypto/KeyGenerator.java | 38 ++---- .../main/java/javax/crypto/KeyGeneratorSpi.java | 15 +- libcore/crypto/src/main/java/javax/crypto/Mac.java | 61 +++------ .../crypto/src/main/java/javax/crypto/MacSpi.java | 30 ++-- .../java/javax/crypto/NoSuchPaddingException.java | 5 - .../src/main/java/javax/crypto/NullCipher.java | 2 - .../src/main/java/javax/crypto/SealedObject.java | 27 +--- .../src/main/java/javax/crypto/SecretKey.java | 7 +- .../main/java/javax/crypto/SecretKeyFactory.java | 30 ++-- .../java/javax/crypto/SecretKeyFactorySpi.java | 12 +- .../java/javax/crypto/ShortBufferException.java | 5 - .../main/java/javax/crypto/interfaces/DHKey.java | 4 +- .../java/javax/crypto/interfaces/DHPrivateKey.java | 2 - .../java/javax/crypto/interfaces/DHPublicKey.java | 4 +- .../main/java/javax/crypto/interfaces/PBEKey.java | 8 +- .../main/java/javax/crypto/spec/DESKeySpec.java | 12 +- .../main/java/javax/crypto/spec/DESedeKeySpec.java | 10 +- .../java/javax/crypto/spec/DHGenParameterSpec.java | 8 +- .../java/javax/crypto/spec/DHParameterSpec.java | 12 +- .../java/javax/crypto/spec/DHPrivateKeySpec.java | 11 +- .../java/javax/crypto/spec/DHPublicKeySpec.java | 10 +- .../java/javax/crypto/spec/IvParameterSpec.java | 6 +- .../java/javax/crypto/spec/OAEPParameterSpec.java | 12 +- .../main/java/javax/crypto/spec/PBEKeySpec.java | 16 +-- .../java/javax/crypto/spec/PBEParameterSpec.java | 10 +- .../src/main/java/javax/crypto/spec/PSource.java | 15 +- .../java/javax/crypto/spec/RC2ParameterSpec.java | 16 +-- .../java/javax/crypto/spec/RC5ParameterSpec.java | 20 ++- .../main/java/javax/crypto/spec/SecretKeySpec.java | 16 +-- 41 files changed, 285 insertions(+), 624 deletions(-) diff --git a/libcore/crypto/src/main/java/javax/crypto/BadPaddingException.java b/libcore/crypto/src/main/java/javax/crypto/BadPaddingException.java index 19fdaa8a2..5e2dd3882 100644 --- a/libcore/crypto/src/main/java/javax/crypto/BadPaddingException.java +++ b/libcore/crypto/src/main/java/javax/crypto/BadPaddingException.java @@ -22,8 +22,6 @@ import java.security.GeneralSecurityException; /** * The exception that is thrown when a padding mechanism is expected for the * input data, but the input data does not have the proper padding bytes. - * - * @since Android 1.0 */ public class BadPaddingException extends GeneralSecurityException { @@ -37,7 +35,6 @@ public class BadPaddingException extends GeneralSecurityException { * * @param msg * the message - * @since Android 1.0 */ public BadPaddingException(String msg) { super(msg); @@ -45,8 +42,6 @@ public class BadPaddingException extends GeneralSecurityException { /** * Creates a new instance of {@code BadPaddingException} with no message. - * - * @since Android 1.0 */ public BadPaddingException() { } diff --git a/libcore/crypto/src/main/java/javax/crypto/Cipher.java b/libcore/crypto/src/main/java/javax/crypto/Cipher.java index ae7222639..8e084aee9 100644 --- a/libcore/crypto/src/main/java/javax/crypto/Cipher.java +++ b/libcore/crypto/src/main/java/javax/crypto/Cipher.java @@ -61,58 +61,41 @@ import org.apache.harmony.security.fortress.Engine; * to be processed at a time can be optionally specified by appending it to the * mode name. e.g. "AES/CFB8/NoPadding". If no number is specified, a * provider specific default value is used. - *

- * - * @since Android 1.0 */ public class Cipher { /** * Constant for decryption operation mode. - * - * @since Android 1.0 */ public static final int DECRYPT_MODE = 2; /** * Constant for encryption operation mode. - * - * @since Android 1.0 */ public static final int ENCRYPT_MODE = 1; /** * Constant indicating that the key to be unwrapped is a private key. - * - * @since Android 1.0 */ public static final int PRIVATE_KEY = 2; /** * Constant indicating that the key to be unwrapped is a public key. - * - * @since Android 1.0 */ public static final int PUBLIC_KEY = 1; /** * Constant indicating that the key to be unwrapped is a secret key. - * - * @since Android 1.0 */ public static final int SECRET_KEY = 3; /** * Constant for key unwrapping operation mode. - * - * @since Android 1.0 */ public static final int UNWRAP_MODE = 4; /** * Constant for key wrapping operation mode. - * - * @since Android 1.0 */ public static final int WRAP_MODE = 3; @@ -147,7 +130,7 @@ public class Cipher { /** * Creates a new Cipher instance. - * + * * @param cipherSpi * the implementation delegate of the cipher. * @param provider @@ -157,7 +140,6 @@ public class Cipher { * @throws NullPointerException * if either cipherSpi is {@code null} or provider is {@code * null} and {@code cipherSpi} is a {@code NullCipherSpi}. - * @since Android 1.0 */ protected Cipher(CipherSpi cipherSpi, Provider provider, String transformation) { @@ -178,7 +160,7 @@ public class Cipher { * transformation. The first found provider providing the transformation is * used to create the cipher. If no provider is found an exception is * thrown. - * + * * @param transformation * the name of the transformation to create a cipher for. * @return a cipher for the requested transformation. @@ -189,7 +171,6 @@ public class Cipher { * @throws NoSuchPaddingException * if no installed provider can provide the padding scheme in * the transformation. - * @since Android 1.0 */ public static final Cipher getInstance(String transformation) throws NoSuchAlgorithmException, NoSuchPaddingException { @@ -199,7 +180,7 @@ public class Cipher { /** * Creates a new cipher for the specified transformation provided by the * specified provider. - * + * * @param transformation * the name of the transformation to create a cipher for. * @param provider @@ -216,7 +197,6 @@ public class Cipher { * is not available. * @throws IllegalArgumentException * if the specified provider is {@code null}. - * @since Android 1.0 */ public static final Cipher getInstance(String transformation, String provider) throws NoSuchAlgorithmException, @@ -235,7 +215,7 @@ public class Cipher { /** * Creates a new cipher for the specified transformation. - * + * * @param transformation * the name of the transformation to create a cipher for. * @param provider @@ -250,7 +230,6 @@ public class Cipher { * is not available. * @throws IllegalArgumentException * if the provider is {@code null}. - * @since Android 1.0 */ public static final Cipher getInstance(String transformation, Provider provider) throws NoSuchAlgorithmException, @@ -373,9 +352,8 @@ public class Cipher { /** * Returns the provider of this cipher instance. - * + * * @return the provider of this cipher instance. - * @since Android 1.0 */ public final Provider getProvider() { return provider; @@ -386,10 +364,8 @@ public class Cipher { *

* This is the name of the transformation argument used in the * {@code getInstance} call creating this object. - *

- * + * * @return the name of the algorithm of this cipher instance. - * @since Android 1.0. */ public final String getAlgorithm() { return transformation; @@ -397,9 +373,8 @@ public class Cipher { /** * Returns this ciphers block size (in bytes). - * + * * @return this ciphers block size. - * @since Android 1.0 */ public final int getBlockSize() { return spiImpl.engineGetBlockSize(); @@ -408,13 +383,12 @@ public class Cipher { /** * Returns the length in bytes an output buffer needs to be when this cipher * is updated with {@code inputLen} bytes. - * + * * @param inputLen * the number of bytes of the input. * @return the output buffer length for the input length. * @throws IllegalStateException * if this cipher instance is in an invalid state. - * @since Android 1.0 */ public final int getOutputSize(int inputLen) { if (mode == 0) { @@ -426,9 +400,8 @@ public class Cipher { /** * Returns the initialization vector for this cipher instance. - * + * * @return the initialization vector for this cipher instance. - * @since Android 1.0 */ public final byte[] getIV() { return spiImpl.engineGetIV(); @@ -440,11 +413,10 @@ public class Cipher { * These may be a the same parameters that were used to create this cipher * instance, or may be a combination of default and random parameters, * depending on the underlying cipher implementation. - * + * * @return the parameters that where used to create this cipher instance, or * {@code null} if this cipher instance does not have any * parameters. - * @since Android 1.0 */ public final AlgorithmParameters getParameters() { return spiImpl.engineGetParameters(); @@ -452,9 +424,8 @@ public class Cipher { /** * Returns the exemption mechanism associated with this cipher. - * + * * @return currently {@code null} - * @since Android 1.0 */ public final ExemptionMechanism getExemptionMechanism() { //FIXME implement getExemptionMechanism @@ -473,7 +444,7 @@ public class Cipher { * The cipher is initialized for the specified operational mode (one of: * encryption, decryption, key wrapping or key unwrapping) depending on * {@code opmode}. - *

+ *

* If this cipher instance needs any algorithm parameters or random values * that the specified key can not provide, the underlying implementation of * this cipher is supposed to generate the required parameters (using its @@ -483,8 +454,7 @@ public class Cipher { * init} methods, the state of the instance is overridden, meaning that it * is equivalent to creating a new instance and calling its {@code init} * method. - *

- * + * * @param opmode * the operation this cipher instance should be initialized for * (one of: {@code ENCRYPT_MODE}, {@code DECRYPT_MODE}, {@code @@ -494,7 +464,6 @@ public class Cipher { * @throws InvalidKeyException * if the specified key can not be used to initialize this * cipher instance. - * @since Android 1.0 */ public final void init(int opmode, Key key) throws InvalidKeyException { if (sec_rand == null) { @@ -513,7 +482,7 @@ public class Cipher { * The cipher is initialized for the specified operational mode (one of: * encryption, decryption, key wrapping or key unwrapping) depending on * {@code opmode}. - *

+ *

* If this cipher instance needs any algorithm parameters or random values * that the specified key can not provide, the underlying implementation of * this cipher is supposed to generate the required parameters (using its @@ -523,8 +492,7 @@ public class Cipher { * When a cipher instance is initialized by a call to any of the {@code * init} methods, the state of the instance is overridden, means it is * equivalent to creating a new instance and calling it {@code init} method. - *

- * + * * @param opmode * the operation this cipher instance should be initialized for * (one of: {@code ENCRYPT_MODE}, {@code DECRYPT_MODE}, {@code @@ -538,7 +506,6 @@ public class Cipher { * cipher instance. * @throws InvalidParameterException * if the specified opmode is invalid. - * @since Android 1.0 */ public final void init(int opmode, Key key, SecureRandom random) throws InvalidKeyException { @@ -559,7 +526,7 @@ public class Cipher { *

* The cipher is initialized for the specified operational mode (one of: * encryption, decryption, key wrapping or key unwrapping). - *

+ *

* If this cipher instance needs any algorithm parameters and {@code params} * is {@code null}, the underlying implementation of this cipher is supposed * to generate the required parameters (using its provider or random @@ -568,8 +535,7 @@ public class Cipher { * When a cipher instance is initialized by a call to any of the {@code * init} methods, the state of the instance is overridden, means it is * equivalent to creating a new instance and calling it {@code init} method. - *

- * + * * @param opmode * the operation this cipher instance should be initialized for * (one of: {@code ENCRYPT_MODE}, {@code DECRYPT_MODE}, {@code @@ -584,7 +550,6 @@ public class Cipher { * @throws InvalidAlgorithmParameterException * it the specified parameters are inappropriate for this * cipher. - * @since Android 1.0 */ public final void init(int opmode, Key key, AlgorithmParameterSpec params) throws InvalidKeyException, InvalidAlgorithmParameterException { @@ -611,7 +576,7 @@ public class Cipher { * init} methods, the state of the instance is overridden, meaning that it * is equivalent to creating a new instance and calling it {@code init} * method. - * + * * @param opmode * the operation this cipher instance should be initialized for * (one of: {@code ENCRYPT_MODE}, {@code DECRYPT_MODE}, {@code @@ -630,7 +595,6 @@ public class Cipher { * cipher. * @throws InvalidParameterException * if the specified {@code opmode} is invalid. - * @since Android 1.0 */ public final void init(int opmode, Key key, AlgorithmParameterSpec params, SecureRandom random) throws InvalidKeyException, @@ -656,7 +620,7 @@ public class Cipher { * The cipher is initialized for the specified operation (one of: * encryption, decryption, key wrapping or key unwrapping) depending on * {@code opmode}. - *

+ *

* If this cipher instance needs any algorithm parameters and {@code params} * is {@code null}, the underlying implementation of this cipher is supposed * to generate the required parameters (using its provider or random @@ -666,8 +630,7 @@ public class Cipher { * init} methods, the state of the instance is overridden, meaning that it * is equivalent to creating a new instance and calling it {@code init} * method. - *

- * + * * @param opmode * the operation this cipher instance should be initialized for * (one of: {@code ENCRYPT_MODE}, {@code DECRYPT_MODE}, {@code @@ -682,7 +645,6 @@ public class Cipher { * @throws InvalidAlgorithmParameterException * it the specified parameters are inappropriate for this * cipher. - * @since Android 1.0 */ public final void init(int opmode, Key key, AlgorithmParameters params) throws InvalidKeyException, InvalidAlgorithmParameterException { @@ -699,7 +661,7 @@ public class Cipher { * The cipher will be initialized for the specified operation (one of: * encryption, decryption, key wrapping or key unwrapping) depending on * {@code opmode}. - *

+ *

* If this cipher instance needs any algorithm parameters and {@code params} * is {@code null}, the underlying implementation of this cipher is supposed * to generate the required parameters (using its provider or random @@ -708,8 +670,7 @@ public class Cipher { * When a cipher instance is initialized by a call to any of the {@code * init} methods, the state of the instance is overridden, means it is * equivalent to creating a new instance and calling it {@code init} method. - *

- * + * * @param opmode * the operation this cipher instance should be initialized for * (one of: {@code ENCRYPT_MODE}, {@code DECRYPT_MODE}, {@code @@ -728,7 +689,6 @@ public class Cipher { * cipher. * @throws InvalidParameterException * if the specified {@code opmode} is invalid. - * @since Android 1.0 */ public final void init(int opmode, Key key, AlgorithmParameters params, SecureRandom random) throws InvalidKeyException, @@ -768,7 +728,7 @@ public class Cipher { * When a cipher instance is initialized by a call to any of the {@code * init} methods, the state of the instance is overridden, means it is * equivalent to creating a new instance and calling it {@code init} method. - * + * * @param opmode * the operation this cipher instance should be initialized for * (one of: {@code ENCRYPT_MODE}, {@code DECRYPT_MODE}, {@code @@ -778,7 +738,6 @@ public class Cipher { * @throws InvalidKeyException * if the public key in the certificate can not be used to * initialize this cipher instance. - * @since Android 1.0 */ public final void init(int opmode, Certificate certificate) throws InvalidKeyException { @@ -795,7 +754,7 @@ public class Cipher { * The cipher will be initialized for the specified operation (one of: * encryption, decryption, key wrapping or key unwrapping) depending on * {@code opmode}. - *

+ *

* It the type of the certificate is X.509 and the certificate has a key * usage extension field marked as critical, the specified {@code * opmode} has the be enabled for this key, otherwise an {@code @@ -806,11 +765,11 @@ public class Cipher { * cipher is supposed to generate the required parameters (using its * provider or random values). Random values are generated using {@code * random}. - *

+ *

* When a cipher instance is initialized by a call to any of the {@code * init} methods, the state of the instance is overridden, means it is * equivalent to creating a new instance and calling it {@code init} method. - * + * * @param opmode * the operation this cipher instance should be initialized for * (one of: {@code ENCRYPT_MODE}, {@code DECRYPT_MODE}, {@code @@ -822,7 +781,6 @@ public class Cipher { * @throws InvalidKeyException * if the public key in the certificate can not be used to * initialize this cipher instance. - * @since Android 1.0 */ public final void init(int opmode, Certificate certificate, SecureRandom random) throws InvalidKeyException { @@ -874,7 +832,7 @@ public class Cipher { /** * Continues a multi-part transformation (encryption or decryption). The * transformed bytes are returned. - * + * * @param input * the input bytes to transform. * @return the transformed bytes in a new buffer, or {@code null} if the @@ -884,7 +842,6 @@ public class Cipher { * decryption. * @throws IllegalArgumentException * if the input is {@code null}. - * @since Android 1.0 */ public final byte[] update(byte[] input) { if (mode != ENCRYPT_MODE && mode != DECRYPT_MODE) { @@ -903,7 +860,7 @@ public class Cipher { /** * Continues a multi-part transformation (encryption or decryption). The * transformed bytes are returned. - * + * * @param input * the input bytes to transform. * @param inputOffset @@ -919,7 +876,6 @@ public class Cipher { * if the input is {@code null}, or if {@code inputOffset} and * {@code inputLen} do not specify a valid chunk in the input * buffer. - * @since Android 1.0 */ public final byte[] update(byte[] input, int inputOffset, int inputLen) { if (mode != ENCRYPT_MODE && mode != DECRYPT_MODE) { @@ -949,8 +905,7 @@ public class Cipher { * a {@code ShortBufferException} is thrown. Use * {@link Cipher#getOutputSize getOutputSize} to check for the size of the * output buffer. - *

- * + * * @param input * the input bytes to transform. * @param inputOffset @@ -969,7 +924,6 @@ public class Cipher { * if the input is {@code null}, the output is {@code null}, or * if {@code inputOffset} and {@code inputLen} do not specify a * valid chunk in the input buffer. - * @since Android 1.0 */ public final int update(byte[] input, int inputOffset, int inputLen, byte[] output) throws ShortBufferException { @@ -984,8 +938,7 @@ public class Cipher { * a {@code ShortBufferException} is thrown. Use * {@link Cipher#getOutputSize getOutputSize} to check for the size of the * output buffer. - *

- * + * * @param input * the input bytes to transform. * @param inputOffset @@ -1006,7 +959,6 @@ public class Cipher { * if the input is {@code null}, the output is {@code null}, or * if {@code inputOffset} and {@code inputLen} do not specify a * valid chunk in the input buffer. - * @since Android 1.0 */ public final int update(byte[] input, int inputOffset, int inputLen, byte[] output, int outputOffset) throws ShortBufferException { @@ -1046,8 +998,7 @@ public class Cipher { * bytes a {@code ShortBufferException} is thrown. Use * {@link Cipher#getOutputSize getOutputSize} to check for the size of the * output buffer. - *

- * + * * @param input * the input buffer to transform. * @param output @@ -1061,7 +1012,6 @@ public class Cipher { * @throws IllegalArgumentException * if the input buffer and the output buffer are the identical * object. - * @since Android 1.0 */ public final int update(ByteBuffer input, ByteBuffer output) throws ShortBufferException { @@ -1081,8 +1031,7 @@ public class Cipher { *

* Processes any bytes that may have been buffered in previous {@code * update} calls. - *

- * + * * @return the final bytes from the transformation. * @throws IllegalBlockSizeException * if the size of the resulting bytes is not a multiple of the @@ -1092,7 +1041,6 @@ public class Cipher { * @throws IllegalStateException * if this cipher instance is not initialized for encryption or * decryption. - * @since Android 1.0 */ public final byte[] doFinal() throws IllegalBlockSizeException, BadPaddingException { @@ -1108,9 +1056,9 @@ public class Cipher { *

* Processes any bytes that may have been buffered in previous {@code * update} calls. - *

+ *

* The final transformed bytes are stored in the {@code output} buffer. - * + * * @param output * the output buffer. * @param outputOffset @@ -1126,7 +1074,6 @@ public class Cipher { * @throws IllegalStateException * if this cipher instance is not initialized for encryption or * decryption. - * @since Android 1.0 */ public final int doFinal(byte[] output, int outputOffset) throws IllegalBlockSizeException, ShortBufferException, @@ -1147,8 +1094,7 @@ public class Cipher { *

* Processes the bytes in {@code input} buffer, and any bytes that have been * buffered in previous {@code update} calls. - *

- * + * * @param input * the input buffer. * @return the final bytes from the transformation. @@ -1160,7 +1106,6 @@ public class Cipher { * @throws IllegalStateException * if this cipher instance is not initialized for encryption or * decryption. - * @since Android 1.0 */ public final byte[] doFinal(byte[] input) throws IllegalBlockSizeException, BadPaddingException { @@ -1177,7 +1122,7 @@ public class Cipher { * Processes the {@code inputLen} bytes in {@code input} buffer at {@code * inputOffset}, and any bytes that have been buffered in previous {@code * update} calls. - * + * * @param input * the input buffer. * @param inputOffset @@ -1196,7 +1141,6 @@ public class Cipher { * @throws IllegalArgumentException * if {@code inputOffset} and {@code inputLen} do not specify an * valid chunk in the input buffer. - * @since Android 1.0 */ public final byte[] doFinal(byte[] input, int inputOffset, int inputLen) throws IllegalBlockSizeException, BadPaddingException { @@ -1218,7 +1162,7 @@ public class Cipher { * Processes the {@code inputLen} bytes in {@code input} buffer at {@code * inputOffset}, and any bytes that have been buffered in previous {@code * update} calls. - * + * * @param input * the input buffer. * @param inputOffset @@ -1241,7 +1185,6 @@ public class Cipher { * @throws IllegalArgumentException * if {@code inputOffset} and {@code inputLen} do not specify an * valid chunk in the input buffer. - * @since Android 1.0 */ public final int doFinal(byte[] input, int inputOffset, int inputLen, byte[] output) throws ShortBufferException, @@ -1255,8 +1198,7 @@ public class Cipher { * Processes the {@code inputLen} bytes in {@code input} buffer at {@code * inputOffset}, and any bytes that have been buffered in previous {@code * update} calls. - *

- * + * * @param input * the input buffer. * @param inputOffset @@ -1281,7 +1223,6 @@ public class Cipher { * @throws IllegalArgumentException * if {@code inputOffset} and {@code inputLen} do not specify an * valid chunk in the input buffer. - * @since Android 1.0 */ public final int doFinal(byte[] input, int inputOffset, int inputLen, byte[] output, int outputOffset) throws ShortBufferException, @@ -1306,8 +1247,7 @@ public class Cipher { * {@code input.position()}, and any bytes that have been buffered in * previous {@code update} calls. The transformed bytes are placed into * {@code output} buffer. - *

- * + * * @param input * the input buffer. * @param output @@ -1326,7 +1266,6 @@ public class Cipher { * @throws IllegalStateException * if this cipher instance is not initialized for encryption or * decryption. - * @since Android 1.0 */ public final int doFinal(ByteBuffer input, ByteBuffer output) throws ShortBufferException, IllegalBlockSizeException, @@ -1344,7 +1283,7 @@ public class Cipher { /** * Wraps a key using this cipher instance. - * + * * @param key * the key to wrap. * @return the wrapped key. @@ -1355,7 +1294,6 @@ public class Cipher { * if this cipher instance can not wrap this key. * @throws IllegalStateException * if this cipher instance is not initialized for wrapping. - * @since Android 1.0 */ public final byte[] wrap(Key key) throws IllegalBlockSizeException, InvalidKeyException { @@ -1368,7 +1306,7 @@ public class Cipher { /** * Unwraps a key using this cipher instance. - * + * * @param wrappedKey * the wrapped key to unwrap. * @param wrappedKeyAlgorithm @@ -1386,7 +1324,6 @@ public class Cipher { * {@code wrappedKeyType} for the {@code wrappedKeyAlgorithm}. * @throws IllegalStateException * if this cipher instance is not initialized for unwrapping. - * @since Android 1.0 */ public final Key unwrap(byte[] wrappedKey, String wrappedKeyAlgorithm, int wrappedKeyType) throws InvalidKeyException, @@ -1401,7 +1338,7 @@ public class Cipher { /** * Returns the maximum key length for the specified transformation. - * + * * @param transformation * the transformation name. * @return the maximum key length, currently {@code Integer.MAX_VALUE}. @@ -1410,7 +1347,6 @@ public class Cipher { * be found. * @throws NullPointerException * if {@code transformation} is {@code null}. - * @since Android 1.0 */ public static final int getMaxAllowedKeyLength(String transformation) throws NoSuchAlgorithmException { @@ -1425,7 +1361,7 @@ public class Cipher { /** * Returns the maximum cipher parameter value for the specified * transformation. If there is no maximum limit, {@code null} is returned. - * + * * @param transformation * the transformation name. * @return a parameter spec holding the maximum value or {@code null}. @@ -1435,7 +1371,6 @@ public class Cipher { * be found. * @throws NullPointerException * if {@code transformation} is {@code null}. - * @since Android 1.0 */ public static final AlgorithmParameterSpec getMaxAllowedParameterSpec( String transformation) throws NoSuchAlgorithmException { diff --git a/libcore/crypto/src/main/java/javax/crypto/CipherInputStream.java b/libcore/crypto/src/main/java/javax/crypto/CipherInputStream.java index ca64c49d6..b2c626d6d 100644 --- a/libcore/crypto/src/main/java/javax/crypto/CipherInputStream.java +++ b/libcore/crypto/src/main/java/javax/crypto/CipherInputStream.java @@ -32,9 +32,6 @@ import java.security.GeneralSecurityException; * by a {@code CipherInputStream}. For example, if a cipher initialized for * decryption is used with a {@code CipherInputStream}, the {@code * CipherInputStream} tries to read the data an decrypt them before returning. - *

- * - * @since Android 1.0 */ public class CipherInputStream extends FilterInputStream { @@ -48,12 +45,11 @@ public class CipherInputStream extends FilterInputStream { /** * Creates a new {@code CipherInputStream} instance for an {@code * InputStream} and a cipher. - * + * * @param is * the input stream to read data from. * @param c * the cipher to process the data with. - * @since Android 1.0 */ public CipherInputStream(InputStream is, Cipher c) { super(is); @@ -65,11 +61,9 @@ public class CipherInputStream extends FilterInputStream { * InputStream} without a cipher. *

* A {@code NullCipher} is created and used to process the data. - *

- * + * * @param is * the input stream to read data from. - * @since Android 1.0 */ protected CipherInputStream(InputStream is) { this(is, new NullCipher()); @@ -77,11 +71,10 @@ public class CipherInputStream extends FilterInputStream { /** * Reads the next byte from this cipher input stream. - * + * * @return the next byte, or {@code -1} if the end of the stream is reached. * @throws IOException * if an error occurs. - * @since Android 1.0 */ @Override public int read() throws IOException { @@ -114,14 +107,13 @@ public class CipherInputStream extends FilterInputStream { /** * Reads the next {@code b.length} bytes from this input stream into buffer * {@code b}. - * + * * @param b * the buffer to be filled with data. * @return the number of bytes filled into buffer {@code b}, or {@code -1} * if the end of the stream is reached. * @throws IOException * if an error occurs. - * @since Android 1.0 */ @Override public int read(byte[] b) throws IOException { @@ -134,8 +126,7 @@ public class CipherInputStream extends FilterInputStream { *

* if {@code b} is {@code null}, the next {@code len} bytes are read and * discarded. - *

- * + * * @param b * the buffer to be filled with data. * @param off @@ -148,7 +139,6 @@ public class CipherInputStream extends FilterInputStream { * if an error occurs. * @throws NullPointerException * if the underlying input stream is {@code null}. - * @since Android 1.0 */ @Override public int read(byte[] b, int off, int len) throws IOException { @@ -175,15 +165,12 @@ public class CipherInputStream extends FilterInputStream { * The number of bytes skipped depends on the result of a call to * {@link CipherInputStream#available() available}. The smaller of n and the * result are the number of bytes being skipped. - *

- * Skipping is (currently) not supported in Android. - * + * * @param n * the number of bytes that should be skipped. * @return the number of bytes actually skipped. * @throws IOException * if an error occurs - * @since Android 1.0 */ @Override public long skip(long n) throws IOException { @@ -199,13 +186,11 @@ public class CipherInputStream extends FilterInputStream { } /** - * Returns the number of bytes available without blocking. It (currently) - * always returns {@code 0} in Android. - * + * Returns the number of bytes available without blocking. + * * @return the number of bytes available, currently zero. * @throws IOException * if an error occurs - * @since Android 1.0 */ @Override public int available() throws IOException { @@ -215,10 +200,9 @@ public class CipherInputStream extends FilterInputStream { /** * Closes this {@code CipherInputStream}, also closes the underlying input * stream and call {@code doFinal} on the cipher object. - * + * * @throws IOException * if an error occurs. - * @since Android 1.0 */ @Override public void close() throws IOException { @@ -232,15 +216,15 @@ public class CipherInputStream extends FilterInputStream { } /** - * Returns whether this input stream supports {@code mark} and {@code reset} - * , which it does not. - * + * Returns whether this input stream supports {@code mark} and + * {@code reset}, which it does not. + * * @return false, since this input stream does not support {@code mark} and * {@code reset}. - * @since Android 1.0 */ @Override public boolean markSupported() { return false; } } + diff --git a/libcore/crypto/src/main/java/javax/crypto/CipherOutputStream.java b/libcore/crypto/src/main/java/javax/crypto/CipherOutputStream.java index 8bce42bbc..1f95b99f3 100644 --- a/libcore/crypto/src/main/java/javax/crypto/CipherOutputStream.java +++ b/libcore/crypto/src/main/java/javax/crypto/CipherOutputStream.java @@ -31,9 +31,6 @@ import javax.crypto.NullCipher; * by a {@code CipherOutputStream}. For example, if a cipher initialized for * encryption is used with a {@code CipherOutputStream}, the {@code * CipherOutputStream} tries to encrypt the data writing it out. - *

- * - * @since Android 1.0 */ public class CipherOutputStream extends FilterOutputStream { @@ -43,12 +40,11 @@ public class CipherOutputStream extends FilterOutputStream { /** * Creates a new {@code CipherOutputStream} instance for an {@code * OutputStream} and a {@code Cipher}. - * + * * @param os * the output stream to write data to. * @param c * the cipher to process the data with. - * @since Android 1.0 */ public CipherOutputStream(OutputStream os, Cipher c) { super(os); @@ -60,11 +56,9 @@ public class CipherOutputStream extends FilterOutputStream { * OutputStream} without a cipher. *

* A {@code NullCipher} is created to process the data. - *

- * + * * @param os * the output stream to write the data to. - * @since Android 1.0 */ protected CipherOutputStream(OutputStream os) { this(os, new NullCipher()); @@ -72,12 +66,11 @@ public class CipherOutputStream extends FilterOutputStream { /** * Writes the single byte to this cipher output stream. - * + * * @param b * the byte to write. * @throws IOException * if an error occurs. - * @since Android 1.0 */ @Override public void write(int b) throws IOException { @@ -91,12 +84,11 @@ public class CipherOutputStream extends FilterOutputStream { /** * Writes the buffer of bytes to this cipher output stream. - * + * * @param b * the buffer of bytes. * @throws IOException * if an error occurs. - * @since Android 1.0 */ @Override public void write(byte[] b) throws IOException { @@ -106,7 +98,7 @@ public class CipherOutputStream extends FilterOutputStream { /** * Writes the {@code len} bytes from buffer {@code b} starting at offset * {@code off} to this cipher output stream. - * + * * @param b * the buffer. * @param off @@ -115,7 +107,6 @@ public class CipherOutputStream extends FilterOutputStream { * the number of bytes. * @throws IOException * if an error occurs. - * @since Android 1.0 */ @Override public void write(byte[] b, int off, int len) throws IOException { @@ -130,7 +121,7 @@ public class CipherOutputStream extends FilterOutputStream { /** * Flushes this cipher output stream. - * + * * @throws IOException * if an error occurs */ @@ -145,7 +136,7 @@ public class CipherOutputStream extends FilterOutputStream { * On the underlying cipher {@code doFinal} will be invoked, and any * buffered bytes from the cipher are also written out, and the cipher is * reset to its initial state. The underlying output stream is also closed. - * + * * @throws IOException * if an error occurs. */ @@ -173,3 +164,4 @@ public class CipherOutputStream extends FilterOutputStream { } } } + diff --git a/libcore/crypto/src/main/java/javax/crypto/CipherSpi.java b/libcore/crypto/src/main/java/javax/crypto/CipherSpi.java index f6da9295e..50fdd497a 100644 --- a/libcore/crypto/src/main/java/javax/crypto/CipherSpi.java +++ b/libcore/crypto/src/main/java/javax/crypto/CipherSpi.java @@ -44,7 +44,7 @@ import org.apache.harmony.crypto.internal.nls.Messages; * * The following behavior should be implemented for obtaining {@code Cipher} * instances. - *

+ *

* When one of the {@link Cipher#getInstance} factory methods is called with a * transformation that is only an algorithm, check if the provider * defines a {@code CipherSpi} for "algorithm", if so: return it, otherwise @@ -76,53 +76,46 @@ import org.apache.harmony.crypto.internal.nls.Messages; * padding name and return it, otherwise throw a * {@link NoSuchAlgorithmException}. * - *

- * + * * @see Cipher - * @since Android 1.0 */ public abstract class CipherSpi { /** * Creates a new {@code CipherSpi} instance. - * - * @since Android 1.0 */ public CipherSpi() { } /** * Sets the mode for this cipher. - * + * * @param mode * the name of the cipher mode. * @throws NoSuchAlgorithmException * if the specified cipher mode is not supported by this * provider. - * @since Android 1.0 */ protected abstract void engineSetMode(String mode) throws NoSuchAlgorithmException; /** * Sets the padding method for this cipher. - * + * * @param padding * the name of the padding method. * @throws NoSuchPaddingException * if the specified padding method is not supported by this * cipher. - * @since Android 1.0 */ protected abstract void engineSetPadding(String padding) throws NoSuchPaddingException; /** * Returns the block size of this cipher (in bytes) - * + * * @return the block size of this cipher, or zero if this cipher is not a * block cipher. - * @since Android 1.0 */ protected abstract int engineGetBlockSize(); @@ -133,21 +126,18 @@ public abstract class CipherSpi { *

* The actual output length of the next call to {@code update} or {@code * doFinal} may be smaller than the length returned by this method. - *

- * + * * @param inputLen * the length of the input (in bytes). * @return the size for a buffer (in bytes). - * @since Android 1.0 */ protected abstract int engineGetOutputSize(int inputLen); /** * Returns the Initialization Vector (IV) that was used to initialize this * cipher or {@code null} if none was used. - * + * * @return the Initialization Vector (IV), or {@code null} if none was used. - * @since Android 1.0 */ protected abstract byte[] engineGetIV(); @@ -157,12 +147,10 @@ public abstract class CipherSpi { * These may be a the same parameters that were used to create this cipher * instance, or may be a combination of default and random parameters, * depending on the underlying cipher implementation. - *

- * + * * @return the parameters that where used to create this cipher instance, or * {@code null} if this cipher instance does not have any parameters * at all. - * @since Android 1.0 */ protected abstract AlgorithmParameters engineGetParameters(); @@ -173,7 +161,7 @@ public abstract class CipherSpi { * The cipher will be initialized for the specified operation (one of: * encryption, decryption, key wrapping or key unwrapping) depending on * {@code opmode}. - *

+ *

* If this cipher instance needs any algorithm parameters or random values * that the specified key cannot provide, the underlying implementation of * this cipher is supposed to generate the required parameters (using its @@ -183,8 +171,7 @@ public abstract class CipherSpi { * When a cipher instance is initialized by a call to any of the {@code * init} methods, the state of the instance is overridden, means it is * equivalent to creating a new instance and calling it {@code init} method. - *

- * + * * @param opmode * the operation this cipher instance should be initialized for * (one of: {@code ENCRYPT_MODE}, {@code DECRYPT_MODE}, {@code @@ -196,7 +183,6 @@ public abstract class CipherSpi { * @throws InvalidKeyException * if the specified key cannot be used to initialize this cipher * instance. - * @since Android 1.0 */ protected abstract void engineInit(int opmode, Key key, SecureRandom random) throws InvalidKeyException; @@ -208,7 +194,7 @@ public abstract class CipherSpi { * The cipher will be initialized for the specified operation (one of: * encryption, decryption, key wrapping or key unwrapping) depending on * {@code opmode}. - *

+ *

* If this cipher instance needs any algorithm parameters and {@code params} * is {@code null}, the underlying implementation of this cipher is supposed * to generate the required parameters (using its provider or random @@ -217,8 +203,7 @@ public abstract class CipherSpi { * When a cipher instance is initialized by a call to any of the {@code * init} methods, the state of the instance is overridden, means it is * equivalent to creating a new instance and calling it {@code init} method. - *

- * + * * @param opmode * the operation this cipher instance should be initialized for * (one of: {@code ENCRYPT_MODE}, {@code DECRYPT_MODE}, {@code @@ -235,7 +220,6 @@ public abstract class CipherSpi { * @throws InvalidAlgorithmParameterException * it the specified parameters are inappropriate for this * cipher. - * @since Android 1.0 */ protected abstract void engineInit(int opmode, Key key, AlgorithmParameterSpec params, SecureRandom random) @@ -248,7 +232,7 @@ public abstract class CipherSpi { * The cipher will be initialized for the specified operation (one of: * encryption, decryption, key wrapping or key unwrapping) depending on * {@code opmode}. - *

+ *

* If this cipher instance needs any algorithm parameters and {@code params} * is {@code null}, the underlying implementation of this cipher is supposed * to generate the required parameters (using its provider or random @@ -257,8 +241,7 @@ public abstract class CipherSpi { * When a cipher instance is initialized by a call to any of the {@code * init} methods, the state of the instance is overridden, means it is * equivalent to creating a new instance and calling it {@code init} method. - *

- * + * * @param opmode * the operation this cipher instance should be initialized for * (one of: {@code ENCRYPT_MODE}, {@code DECRYPT_MODE}, {@code @@ -275,7 +258,6 @@ public abstract class CipherSpi { * @throws InvalidAlgorithmParameterException * if the specified parameters are inappropriate for this * cipher. - * @since Android 1.0 */ protected abstract void engineInit(int opmode, Key key, AlgorithmParameters params, SecureRandom random) @@ -284,7 +266,7 @@ public abstract class CipherSpi { /** * Continues a multi-part transformation (encryption or decryption). The * transformed bytes are returned. - * + * * @param input * the input bytes to transform. * @param inputOffset @@ -299,7 +281,6 @@ public abstract class CipherSpi { * @throws IllegalArgumentException * if the input is null, or if {@code inputOffset} and {@code * inputLen} do not specify a valid chunk in the input buffer. - * @since Android 1.0 */ protected abstract byte[] engineUpdate(byte[] input, int inputOffset, int inputLen); @@ -312,8 +293,7 @@ public abstract class CipherSpi { * a {@code ShortBufferException} is thrown. Use * {@link Cipher#getOutputSize getOutputSize} to check for the size of the * output buffer. - *

- * + * * @param input * the input bytes to transform. * @param inputOffset @@ -327,7 +307,6 @@ public abstract class CipherSpi { * @return the number of bytes placed in output. * @throws ShortBufferException * if the size of the {@code output} buffer is too small. - * @since Android 1.0 */ protected abstract int engineUpdate(byte[] input, int inputOffset, int inputLen, byte[] output, int outputOffset) @@ -342,8 +321,7 @@ public abstract class CipherSpi { * bytes a {@code ShortBufferException} is thrown. Use * {@link Cipher#getOutputSize getOutputSize} to check for the size of the * output buffer. - *

- * + * * @param input * the input buffer to transform. * @param output @@ -351,7 +329,6 @@ public abstract class CipherSpi { * @return the number of bytes stored in the output buffer. * @throws ShortBufferException * if the size of the {@code output} buffer is too small. - * @since Android 1.0 */ protected int engineUpdate(ByteBuffer input, ByteBuffer output) throws ShortBufferException { @@ -395,8 +372,7 @@ public abstract class CipherSpi { * Processes the {@code inputLen} bytes in {@code input} buffer at {@code * inputOffset}, and any bytes that have been buffered in previous {@code * update} calls. - *

- * + * * @param input * the input buffer. * @param inputOffset @@ -409,7 +385,6 @@ public abstract class CipherSpi { * cipher block size. * @throws BadPaddingException * if the padding of the data does not match the padding scheme. - * @since Android 1.0 */ protected abstract byte[] engineDoFinal(byte[] input, int inputOffset, int inputLen) throws IllegalBlockSizeException, BadPaddingException; @@ -418,10 +393,9 @@ public abstract class CipherSpi { * Finishes a multi-part transformation (encryption or decryption). *

* Processes the {@code inputLen} bytes in {@code input} buffer at - * {@code inputOffset}, and any bytes that have been buffered in previous + * {@code inputOffset}, and any bytes that have been buffered in previous * {@code update} calls. - *

- * + * * @param input * the input buffer. * @param inputOffset @@ -440,7 +414,6 @@ public abstract class CipherSpi { * cipher block size. * @throws BadPaddingException * if the padding of the data does not match the padding scheme. - * @since Android 1.0 */ protected abstract int engineDoFinal(byte[] input, int inputOffset, int inputLen, byte[] output, int outputOffset) @@ -454,8 +427,7 @@ public abstract class CipherSpi { * {@code input.position()}, and any bytes that have been buffered in * previous {@code update} calls. The transformed bytes are placed into * {@code output} buffer. - *

- * + * * @param input * the input buffer. * @param output @@ -519,7 +491,7 @@ public abstract class CipherSpi { * this class (for backwards compatibility, it cannot be abstract). If this * method is not overridden, it throws an {@code * UnsupportedOperationException}. - * + * * @param key * the key to wrap. * @return the wrapped key @@ -528,7 +500,6 @@ public abstract class CipherSpi { * cipher block size. * @throws InvalidKeyException * if this cipher instance cannot wrap this key. - * @since Android 1.0 */ protected byte[] engineWrap(Key key) throws IllegalBlockSizeException, InvalidKeyException { @@ -542,8 +513,7 @@ public abstract class CipherSpi { * This method has been added to this class (for backwards compatibility, it * cannot be abstract). If this method is not overridden, it throws an * {@code UnsupportedOperationException}. - *

- * + * * @param wrappedKey * the wrapped key to unwrap. * @param wrappedKeyAlgorithm @@ -559,7 +529,6 @@ public abstract class CipherSpi { * @throws NoSuchAlgorithmException * if no provider can be found that can create a key of type * {@code wrappedKeyType} for the {@code wrappedKeyAlgorithm}. - * @since Android 1.0 */ protected Key engineUnwrap(byte[] wrappedKey, String wrappedKeyAlgorithm, int wrappedKeyType) throws InvalidKeyException, @@ -573,17 +542,16 @@ public abstract class CipherSpi { * added to this class (for backwards compatibility, it cannot be abstract). * If this method is not overridden, it throws an {@code * UnsupportedOperationException}. - * + * * @param key * the key to get the size for. * @return the size of a specified key object in bits. * @throws InvalidKeyException * if the size of the key cannot be determined by this * implementation. - * @since Android 1.0 */ protected int engineGetKeySize(Key key) throws InvalidKeyException { throw new UnsupportedOperationException( Messages.getString("crypto.12")); //$NON-NLS-1$ } -} +} \ No newline at end of file diff --git a/libcore/crypto/src/main/java/javax/crypto/EncryptedPrivateKeyInfo.java b/libcore/crypto/src/main/java/javax/crypto/EncryptedPrivateKeyInfo.java index 301cd4924..2d0fd259d 100644 --- a/libcore/crypto/src/main/java/javax/crypto/EncryptedPrivateKeyInfo.java +++ b/libcore/crypto/src/main/java/javax/crypto/EncryptedPrivateKeyInfo.java @@ -46,7 +46,6 @@ import org.apache.harmony.security.x509.AlgorithmIdentifier; * #8 - Private-Key Information Syntax Standard. *

* The definition of ASN.1 is as follows: - *

*
* EncryptedPrivateKeyInfo ::= SEQUENCE { *
encryptionAlgorithm AlgorithmIdentifier,
@@ -57,8 +56,6 @@ import org.apache.harmony.security.x509.AlgorithmIdentifier; *
algorithm OBJECT IDENTIFIER,
*
parameters ANY DEFINED BY algorithm OPTIONAL }
*
- * - * @since Android 1.0 */ public class EncryptedPrivateKeyInfo { // Encryption algorithm name @@ -75,14 +72,13 @@ public class EncryptedPrivateKeyInfo { /** * Creates an {@code EncryptedPrivateKeyInfo} instance from its encoded * representation by parsing it. - * + * * @param encoded * the encoded representation of this object * @throws IOException * if parsing the encoded representation fails. * @throws NullPointerException * if {@code encoded} is {@code null}. - * @since Android 1.0 */ public EncryptedPrivateKeyInfo(byte[] encoded) throws IOException { @@ -127,7 +123,7 @@ public class EncryptedPrivateKeyInfo { /** * Creates an {@code EncryptedPrivateKeyInfo} instance from an algorithm * name and its encrypted data. - * + * * @param encrAlgName * the name of an algorithm. * @param encryptedData @@ -139,7 +135,6 @@ public class EncryptedPrivateKeyInfo { * null}. * @throws IllegalArgumentException * if {@code encryptedData} is empty. - * @since Android 1.0 */ public EncryptedPrivateKeyInfo(String encrAlgName, byte[] encryptedData) throws NoSuchAlgorithmException { @@ -166,7 +161,7 @@ public class EncryptedPrivateKeyInfo { /** * Creates an {@code EncryptedPrivateKeyInfo} instance from the * encryption algorithm parameters an its encrypted data. - * + * * @param algParams * the encryption algorithm parameters. * @param encryptedData @@ -177,7 +172,6 @@ public class EncryptedPrivateKeyInfo { * @throws NullPointerException * if {@code algParams} or {@code encryptedData} is * {@code null}. - * @since Android 1.0 */ public EncryptedPrivateKeyInfo(AlgorithmParameters algParams, byte[] encryptedData) @@ -204,9 +198,8 @@ public class EncryptedPrivateKeyInfo { /** * Returns the name of the encryption algorithm. - * + * * @return the name of the encryption algorithm. - * @since Android 1.0 */ public String getAlgName() { return algName; @@ -214,9 +207,8 @@ public class EncryptedPrivateKeyInfo { /** * Returns the parameters used by the encryption algorithm. - * + * * @return the parameters used by the encryption algorithm. - * @since Android 1.0 */ public AlgorithmParameters getAlgParameters() { return algParameters; @@ -224,10 +216,9 @@ public class EncryptedPrivateKeyInfo { /** * Returns the encrypted data of this key. - * + * * @return the encrypted data of this key, each time this method is called a * new array is returned. - * @since Android 1.0 */ public byte[] getEncryptedData() { byte[] ret = new byte[encryptedData.length]; @@ -242,8 +233,7 @@ public class EncryptedPrivateKeyInfo { * The cipher must be initialize in either {@code Cipher.DECRYPT_MODE} or * {@code Cipher.UNWRAP_MODE} with the same parameters and key used for * encrypting this. - *

- * + * * @param cipher * the cipher initialized for decrypting the encrypted data. * @return the extracted {@code PKCS8EncodedKeySpec}. @@ -252,7 +242,6 @@ public class EncryptedPrivateKeyInfo { * encrypted data. * @throws NullPointerException * if {@code cipher} is {@code null}. - * @since Android 1.0 */ public PKCS8EncodedKeySpec getKeySpec(Cipher cipher) throws InvalidKeySpecException { @@ -280,7 +269,7 @@ public class EncryptedPrivateKeyInfo { /** * Returns the {@code PKCS8EncodedKeySpec} object extracted from the * encrypted data. - * + * * @param decryptKey * the key to decrypt the encrypted data with. * @return the extracted {@code PKCS8EncodedKeySpec}. @@ -292,7 +281,6 @@ public class EncryptedPrivateKeyInfo { * data. * @throws NullPointerException * if {@code decryptKey} is {@code null}. - * @since Android 1.0 */ public PKCS8EncodedKeySpec getKeySpec(Key decryptKey) throws NoSuchAlgorithmException, @@ -331,7 +319,7 @@ public class EncryptedPrivateKeyInfo { /** * Returns the {@code PKCS8EncodedKeySpec} object extracted from the * encrypted data. - * + * * @param decryptKey * the key to decrypt the encrypted data with. * @param providerName @@ -349,7 +337,6 @@ public class EncryptedPrivateKeyInfo { * @throws NullPointerException * if {@code decryptKey} or {@code providerName} is {@code null} * . - * @since Android 1.0 */ public PKCS8EncodedKeySpec getKeySpec(Key decryptKey, String providerName) throws NoSuchProviderException, @@ -393,7 +380,7 @@ public class EncryptedPrivateKeyInfo { /** * Returns the {@code PKCS8EncodedKeySpec} object extracted from the * encrypted data. - * + * * @param decryptKey * the key to decrypt the encrypted data with. * @param provider @@ -407,7 +394,6 @@ public class EncryptedPrivateKeyInfo { * data. * @throws NullPointerException * if {@code decryptKey} or {@code provider} is {@code null}. - * @since Android 1.0 */ public PKCS8EncodedKeySpec getKeySpec(Key decryptKey, Provider provider) throws NoSuchAlgorithmException, @@ -448,11 +434,10 @@ public class EncryptedPrivateKeyInfo { /** * Returns the ASN.1 encoded representation of this object. - * + * * @return the ASN.1 encoded representation of this object. * @throws IOException * if encoding this object fails. - * @since Android 1.0 */ public byte[] getEncoded() throws IOException { if (encoded == null) { diff --git a/libcore/crypto/src/main/java/javax/crypto/ExemptionMechanism.java b/libcore/crypto/src/main/java/javax/crypto/ExemptionMechanism.java index 7c68d288f..76c88cbd0 100644 --- a/libcore/crypto/src/main/java/javax/crypto/ExemptionMechanism.java +++ b/libcore/crypto/src/main/java/javax/crypto/ExemptionMechanism.java @@ -34,8 +34,6 @@ import org.apache.harmony.security.fortress.Engine; /** * This class implements the functionality of an exemption mechanism such as * key recovery, key weakening, or key escrow. - * - * @since Android 1.0 */ public class ExemptionMechanism { @@ -62,14 +60,13 @@ public class ExemptionMechanism { /** * Creates a {@code ExemptionMechanism} instance. - * + * * @param exmechSpi * the implementation delegate. * @param provider * the associated provider. * @param mechanism * the name of the mechanism. - * @since Android 1.0 */ protected ExemptionMechanism(ExemptionMechanismSpi exmechSpi, Provider provider, String mechanism) { @@ -81,9 +78,8 @@ public class ExemptionMechanism { /** * Returns the name of this {@code ExemptionMechanism}. - * + * * @return the name of this {@code ExemptionMechanism}. - * @since Android 1.0 */ public final String getName() { return mechanism; @@ -92,7 +88,7 @@ public class ExemptionMechanism { /** * Returns a new {@code ExemptionMechanism} instance that provides the * specified exemption mechanism algorithm. - * + * * @param algorithm * the name of the requested exemption mechanism. * @return the new {@code ExemptionMechanism} instance. @@ -100,7 +96,6 @@ public class ExemptionMechanism { * if the specified algorithm is not available by any provider. * @throws NullPointerException * if the algorithm parameter is {@code null}. - * @since Android 1.0 */ public static final ExemptionMechanism getInstance(String algorithm) throws NoSuchAlgorithmException { @@ -117,7 +112,7 @@ public class ExemptionMechanism { /** * Returns a new {@code ExemptionMechansm} instance that provides the * specified exemption mechanism algorithm from the specified provider. - * + * * @param algorithm * the name of the requested exemption mechanism. * @param provider @@ -132,7 +127,6 @@ public class ExemptionMechanism { * if the algorithm parameter is {@code null}. * @throws IllegalArgumentException * if the provider parameter is {@code null}. - * @since Android 1.0 */ public static final ExemptionMechanism getInstance(String algorithm, String provider) throws NoSuchAlgorithmException, @@ -153,7 +147,7 @@ public class ExemptionMechanism { /** * Returns a new {@code ExemptionMechanism} instance that provides the * specified exemption mechanism algorithm from the specified provider. - * + * * @param algorithm * the name of the requested exemption mechanism. * @param provider @@ -166,7 +160,6 @@ public class ExemptionMechanism { * if the algorithm parameter is {@code null}. * @throws IllegalArgumentException * if the provider parameter is {@code null}. - * @since Android 1.0 */ public static final ExemptionMechanism getInstance(String algorithm, Provider provider) throws NoSuchAlgorithmException { @@ -185,9 +178,8 @@ public class ExemptionMechanism { /** * Returns the provider of this {@code ExemptionMechanism} instance. - * + * * @return the provider of this {@code ExemptionMechanism} instance. - * @since Android 1.0 */ public final Provider getProvider() { return provider; @@ -197,7 +189,7 @@ public class ExemptionMechanism { * Returns whether the result blob for this {@code ExemptionMechanism} * instance has been generated successfully and that the specified key is * the same as the one that was used to initialize and generate. - * + * * @param key * the key to verify. * @return whether the result blob for this {@code ExemptionMechanism} @@ -205,7 +197,6 @@ public class ExemptionMechanism { * @throws ExemptionMechanismException * if an error occurs while determining whether the result blob * has been generated successfully. - * @since Android 1.0 */ public final boolean isCryptoAllowed(Key key) throws ExemptionMechanismException { @@ -222,14 +213,13 @@ public class ExemptionMechanism { * Returns the size in bytes for the output buffer needed to hold the output * of the next {@link #genExemptionBlob} call, given the specified {@code * inputLen} (in bytes). - * + * * @param inputLen * the specified input length (in bytes). * @return the size in bytes for the output buffer. * @throws IllegalStateException * if this {@code ExemptionMechanism} instance is not * initialized. - * @since Android 1.0 */ public final int getOutputSize(int inputLen) throws IllegalStateException { if (!isInit) { @@ -241,14 +231,13 @@ public class ExemptionMechanism { /** * Initializes this {@code ExemptionMechanism} instance with the * specified key. - * + * * @param key * the key to initialize this instance with. * @throws InvalidKeyException * if the key cannot be used to initialize this mechanism. * @throws ExemptionMechanismException * if error(s) occur during initialization. - * @since Android 1.0 */ public final void init(Key key) throws InvalidKeyException, ExemptionMechanismException { @@ -261,7 +250,7 @@ public class ExemptionMechanism { /** * Initializes this {@code ExemptionMechanism} instance with the * specified key and algorithm parameters. - * + * * @param key * the key to initialize this instance with. * @param param @@ -273,7 +262,6 @@ public class ExemptionMechanism { * mechanism. * @throws ExemptionMechanismException * if error(s) occur during initialization. - * @since Android 1.0 */ public final void init(Key key, AlgorithmParameters param) throws InvalidKeyException, InvalidAlgorithmParameterException, @@ -287,7 +275,7 @@ public class ExemptionMechanism { /** * Initializes this {@code ExemptionMechanism} instance with the * specified key and algorithm parameters. - * + * * @param key * the key to initialize this instance with. * @param param @@ -299,7 +287,6 @@ public class ExemptionMechanism { * mechanism. * @throws ExemptionMechanismException * if error(s) occur during initialization. - * @since Android 1.0 */ public final void init(Key key, AlgorithmParameterSpec param) throws InvalidKeyException, InvalidAlgorithmParameterException, @@ -312,14 +299,13 @@ public class ExemptionMechanism { /** * Generates the result key blob for this exemption mechanism. - * + * * @return the result key blob for this exemption mechanism. * @throws IllegalStateException * if this {@code ExemptionMechanism} instance is not * initialized. * @throws ExemptionMechanismException * if error(s) occur during generation. - * @since Android 1.0 */ public final byte[] genExemptionBlob() throws IllegalStateException, ExemptionMechanismException { @@ -335,7 +321,7 @@ public class ExemptionMechanism { /** * Generates the result key blob for this exemption mechanism and stores it * into the {@code output} buffer. - * + * * @param output * the output buffer for the result key blob. * @return the number of bytes written to the {@code output} buffer. @@ -346,7 +332,6 @@ public class ExemptionMechanism { * if the provided buffer is too small for the result key blob. * @throws ExemptionMechanismException * if error(s) occur during generation. - * @since Android 1.0 */ public final int genExemptionBlob(byte[] output) throws IllegalStateException, ShortBufferException, @@ -357,7 +342,7 @@ public class ExemptionMechanism { /** * Generates the result key blob for this exemption mechanism and stores it * into the {@code output} buffer at offset {@code outputOffset}. - * + * * @param output * the output buffer for the result key blob. * @param outputOffset @@ -370,7 +355,6 @@ public class ExemptionMechanism { * if the provided buffer is too small for the result key blob. * @throws ExemptionMechanismException * if error(s) occur during generation. - * @since Android 1.0 */ public final int genExemptionBlob(byte[] output, int outputOffset) throws IllegalStateException, ShortBufferException, @@ -386,8 +370,6 @@ public class ExemptionMechanism { /** * Frees the references to the key used to initialize this instance. - * - * @since Android 1.0 */ @Override protected void finalize() { diff --git a/libcore/crypto/src/main/java/javax/crypto/ExemptionMechanismException.java b/libcore/crypto/src/main/java/javax/crypto/ExemptionMechanismException.java index 3af498b4a..d094ac359 100644 --- a/libcore/crypto/src/main/java/javax/crypto/ExemptionMechanismException.java +++ b/libcore/crypto/src/main/java/javax/crypto/ExemptionMechanismException.java @@ -21,8 +21,6 @@ import java.security.GeneralSecurityException; /** * This is the base class for {@code ExemptionMechanismException}. - * - * @since Android 1.0 */ public class ExemptionMechanismException extends GeneralSecurityException { @@ -37,7 +35,6 @@ public class ExemptionMechanismException extends GeneralSecurityException { * * @param msg * the exception message. - * @since Android 1.0 */ public ExemptionMechanismException(String msg) { super(msg); @@ -45,8 +42,6 @@ public class ExemptionMechanismException extends GeneralSecurityException { /** * Creates a new {@code ExemptionMechanismException} with no message. - * - * @since Android 1.0 */ public ExemptionMechanismException() { } diff --git a/libcore/crypto/src/main/java/javax/crypto/ExemptionMechanismSpi.java b/libcore/crypto/src/main/java/javax/crypto/ExemptionMechanismSpi.java index cef151632..39a27f6ab 100644 --- a/libcore/crypto/src/main/java/javax/crypto/ExemptionMechanismSpi.java +++ b/libcore/crypto/src/main/java/javax/crypto/ExemptionMechanismSpi.java @@ -26,26 +26,21 @@ import java.security.spec.AlgorithmParameterSpec; /** * The Service Provider Interface (SPI) definition for the {@code * ExemptionMechanism} class. - * - * @since Android 1.0 */ public abstract class ExemptionMechanismSpi { /** * Creates a new {@code ExemptionMechanismSpi} instance. - * - * @since Android 1.0 */ public ExemptionMechanismSpi() { } /** * Generates the result key blob for this exemption mechanism. - * + * * @return the result key blob for this exemption mechanism. * @throws ExemptionMechanismException * if error(s) occur during generation. - * @since Android 1.0 */ protected abstract byte[] engineGenExemptionBlob() throws ExemptionMechanismException; @@ -53,7 +48,7 @@ public abstract class ExemptionMechanismSpi { /** * Generates the result key blob for this exemption mechanism and stores it * into the {@code output} buffer at offset {@code outputOffset}. - * + * * @param output * the output buffer for the result key blob. * @param outputOffset @@ -63,7 +58,6 @@ public abstract class ExemptionMechanismSpi { * if the provided buffer is too small for the result key blob. * @throws ExemptionMechanismException * if error(s) occur during generation. - * @since Android 1.0 */ protected abstract int engineGenExemptionBlob(byte[] output, int outputOffset) throws ShortBufferException, @@ -73,7 +67,7 @@ public abstract class ExemptionMechanismSpi { * Returns the size in bytes for the output buffer needed to hold the output * of the next {@link #engineGenExemptionBlob} call, given the specified * {@code inputLen} (in bytes). - * + * * @param inputLen * the specified input length (in bytes). * @return the size in bytes for the output buffer. @@ -83,14 +77,13 @@ public abstract class ExemptionMechanismSpi { /** * Initializes this {@code ExemptionMechanism} instance with the specified * key. - * + * * @param key * the key to initialize this instance with. * @throws InvalidKeyException * if the key cannot be used to initialize this mechanism. * @throws ExemptionMechanismException * if error(s) occur during initialization. - * @since Android 1.0 */ protected abstract void engineInit(Key key) throws InvalidKeyException, ExemptionMechanismException; @@ -98,7 +91,7 @@ public abstract class ExemptionMechanismSpi { /** * Initializes this {@code ExemptionMechanism} instance with the specified * key and algorithm parameters. - * + * * @param key * the key to initialize this instance with. * @param params @@ -110,7 +103,6 @@ public abstract class ExemptionMechanismSpi { * mechanism. * @throws ExemptionMechanismException * if error(s) occur during initialization. - * @since Android 1.0 */ protected abstract void engineInit(Key key, AlgorithmParameters params) throws InvalidKeyException, InvalidAlgorithmParameterException, @@ -119,7 +111,7 @@ public abstract class ExemptionMechanismSpi { /** * Initializes this {@code ExemptionMechanism} instance with the specified * key and algorithm parameters. - * + * * @param key * the key to initialize this instance with. * @param params @@ -131,7 +123,6 @@ public abstract class ExemptionMechanismSpi { * mechanism. * @throws ExemptionMechanismException * if error(s) occur during initialization. - * @since Android 1.0 */ protected abstract void engineInit(Key key, AlgorithmParameterSpec params) throws InvalidKeyException, InvalidAlgorithmParameterException, diff --git a/libcore/crypto/src/main/java/javax/crypto/IllegalBlockSizeException.java b/libcore/crypto/src/main/java/javax/crypto/IllegalBlockSizeException.java index e376b85a1..0766b7cca 100644 --- a/libcore/crypto/src/main/java/javax/crypto/IllegalBlockSizeException.java +++ b/libcore/crypto/src/main/java/javax/crypto/IllegalBlockSizeException.java @@ -22,8 +22,6 @@ import java.security.GeneralSecurityException; /** * The exception, that is thrown when the data length provided to a block cipher * does not match the block size of the cipher. - * - * @since Android 1.0 */ public class IllegalBlockSizeException extends GeneralSecurityException { @@ -38,7 +36,6 @@ public class IllegalBlockSizeException extends GeneralSecurityException { * * @param msg * the message - * @since Android 1.0 */ public IllegalBlockSizeException(String msg) { super(msg); @@ -46,8 +43,6 @@ public class IllegalBlockSizeException extends GeneralSecurityException { /** * Creates a new {@code IllegalBlockSizeException}. - * - * @since Android 1.0 */ public IllegalBlockSizeException() { } diff --git a/libcore/crypto/src/main/java/javax/crypto/KeyAgreement.java b/libcore/crypto/src/main/java/javax/crypto/KeyAgreement.java index ee1f195f7..593aa378d 100644 --- a/libcore/crypto/src/main/java/javax/crypto/KeyAgreement.java +++ b/libcore/crypto/src/main/java/javax/crypto/KeyAgreement.java @@ -34,8 +34,6 @@ import org.apache.harmony.security.fortress.Engine; * This class provides the functionality for a key exchange protocol. This * enables two or more parties to agree on a secret key for symmetric * cryptography. - * - * @since Android 1.0 */ public class KeyAgreement { @@ -56,14 +54,13 @@ public class KeyAgreement { /** * Creates a new {@code KeyAgreement} instance. - * + * * @param keyAgreeSpi * the SPI delegate. * @param provider * the provider providing this KeyAgreement. * @param algorithm * the name of the key agreement algorithm. - * @since Android 1.0 */ protected KeyAgreement(KeyAgreementSpi keyAgreeSpi, Provider provider, String algorithm) { @@ -74,9 +71,8 @@ public class KeyAgreement { /** * Returns the name of the key agreement algorithm. - * + * * @return the name of the key agreement algorithm. - * @since Android 1.0 */ public final String getAlgorithm() { return algorithm; @@ -84,9 +80,8 @@ public class KeyAgreement { /** * Returns the provider for this {@code KeyAgreement} instance. - * + * * @return the provider for this {@code KeyAgreement} instance. - * @since Android 1.0 */ public final Provider getProvider() { return provider; @@ -94,7 +89,7 @@ public class KeyAgreement { /** * Creates a new {@code KeyAgreement} for the specified algorithm. - * + * * @param algorithm * the name of the key agreement algorithm to create. * @return a key agreement for the specified algorithm. @@ -102,7 +97,6 @@ public class KeyAgreement { * if no installed provider can provide the requested algorithm. * @throws NullPointerException * if the specified algorithm is {@code null}. - * @since Android 1.0 */ public static final KeyAgreement getInstance(String algorithm) throws NoSuchAlgorithmException { @@ -119,7 +113,7 @@ public class KeyAgreement { /** * Creates a new {@code KeyAgreement} for the specified algorithm from the * specified provider. - * + * * @param algorithm * the name of the key agreement algorithm to create. * @param provider @@ -134,7 +128,6 @@ public class KeyAgreement { * if the specified provider does not exist. * @throws IllegalArgumentException * if the specified provider name is {@code null} or empty. - * @since Android 1.0 */ public static final KeyAgreement getInstance(String algorithm, String provider) throws NoSuchAlgorithmException, @@ -152,7 +145,7 @@ public class KeyAgreement { /** * Create a new {@code KeyAgreement} for the specified algorithm from the * specified provider. - * + * * @param algorithm * the name of the key agreement algorithm to create. * @param provider @@ -184,13 +177,12 @@ public class KeyAgreement { /** * Initializes this {@code KeyAgreement} with the specified key. - * + * * @param key * the key to initialize this key agreement. * @throws InvalidKeyException * if the specified key cannot be used to initialize this key * agreement. - * @since Android 1.0 */ public final void init(Key key) throws InvalidKeyException { spiImpl.engineInit(key, rndm);//new SecureRandom()); @@ -199,7 +191,7 @@ public class KeyAgreement { /** * Initializes this {@code KeyAgreement} with the specified key and the * specified randomness source. - * + * * @param key * the key to initialize this key agreement. * @param random @@ -207,7 +199,6 @@ public class KeyAgreement { * @throws InvalidKeyException * if the specified key cannot be used to initialize this key * agreement. - * @since Android 1.0 */ public final void init(Key key, SecureRandom random) throws InvalidKeyException { @@ -217,7 +208,7 @@ public class KeyAgreement { /** * Initializes this {@code KeyAgreement} with the specified key and the * algorithm parameters. - * + * * @param key * the key to initialize this key agreement. * @param params @@ -228,7 +219,6 @@ public class KeyAgreement { * @throws InvalidAlgorithmParameterException * if the specified parameters are invalid for this key * agreement algorithm. - * @since Android 1.0 */ public final void init(Key key, AlgorithmParameterSpec params) throws InvalidKeyException, InvalidAlgorithmParameterException { @@ -238,7 +228,7 @@ public class KeyAgreement { /** * Initializes this {@code KeyAgreement} with the specified key, algorithm * parameters and randomness source. - * + * * @param key * the key to initialize this key agreement. * @param params @@ -251,7 +241,6 @@ public class KeyAgreement { * @throws InvalidAlgorithmParameterException * if the specified parameters are invalid for this key * agreement algorithm. - * @since Android 1.0 */ public final void init(Key key, AlgorithmParameterSpec params, SecureRandom random) throws InvalidKeyException, @@ -262,7 +251,7 @@ public class KeyAgreement { /** * Does the next (or the last) phase of the key agreement, using the * specified key. - * + * * @param key * the key received from the other party for this phase. * @param lastPhase @@ -275,7 +264,6 @@ public class KeyAgreement { * this phase, * @throws IllegalStateException * if this instance has not been initialized. - * @since Android 1.0 */ public final Key doPhase(Key key, boolean lastPhase) throws InvalidKeyException, IllegalStateException { @@ -284,11 +272,10 @@ public class KeyAgreement { /** * Generates the shared secret. - * + * * @return the generated shared secret. * @throws IllegalStateException * if this key agreement is not complete. - * @since Android 1.0 */ public final byte[] generateSecret() throws IllegalStateException { return spiImpl.engineGenerateSecret(); @@ -297,7 +284,7 @@ public class KeyAgreement { /** * Generates the shared secret and stores it into the buffer {@code * sharedSecred} at {@code offset}. - * + * * @param sharedSecret * the buffer to store the shared secret. * @param offset @@ -307,7 +294,6 @@ public class KeyAgreement { * if this key agreement is not complete. * @throws ShortBufferException * if the specified buffer is too small for the shared secret. - * @since Android 1.0 */ public final int generateSecret(byte[] sharedSecret, int offset) throws IllegalStateException, ShortBufferException { @@ -316,7 +302,7 @@ public class KeyAgreement { /** * Generates the shared secret. - * + * * @param algorithm * the algorithm to for the {@code SecretKey} * @return the shared secret as a {@code SecretKey} of the specified @@ -329,7 +315,6 @@ public class KeyAgreement { * @throws InvalidKeyException * if a {@code SecretKey} with the specified algorithm cannot be * created using the generated shared secret. - * @since Android 1.0 */ public final SecretKey generateSecret(String algorithm) throws IllegalStateException, NoSuchAlgorithmException, diff --git a/libcore/crypto/src/main/java/javax/crypto/KeyAgreementSpi.java b/libcore/crypto/src/main/java/javax/crypto/KeyAgreementSpi.java index fa9f3772f..50111837c 100644 --- a/libcore/crypto/src/main/java/javax/crypto/KeyAgreementSpi.java +++ b/libcore/crypto/src/main/java/javax/crypto/KeyAgreementSpi.java @@ -27,15 +27,11 @@ import java.security.spec.AlgorithmParameterSpec; /** * The Service Provider Interface (SPI) definition for the * {@code KeyAgreement} class. - * - * @since Android 1.0 */ public abstract class KeyAgreementSpi { - + /** * Creates a new {@code KeyAgreementSpi} instance. - * - * @since Android 1.0 */ public KeyAgreementSpi() { } @@ -43,7 +39,7 @@ public abstract class KeyAgreementSpi { /** * Does the next (or the last) phase of the key agreement, using the * specified key. - * + * * @param key * the key received from the other party for this phase. * @param lastPhase @@ -56,18 +52,16 @@ public abstract class KeyAgreementSpi { * this phase, * @throws IllegalStateException * if this instance has not been initialized. - * @since Android 1.0 */ protected abstract Key engineDoPhase(Key key, boolean lastPhase) throws InvalidKeyException, IllegalStateException; /** * Generates the shared secret. - * + * * @return the generated shared secret. * @throws IllegalStateException * if this key agreement is not complete. - * @since Android 1.0 */ protected abstract byte[] engineGenerateSecret() throws IllegalStateException; @@ -75,7 +69,7 @@ public abstract class KeyAgreementSpi { /** * Generates the shared secret and stores it into the buffer {@code * sharedSecred} at {@code offset}. - * + * * @param sharedSecret * the buffer to store the shared secret. * @param offset @@ -85,14 +79,13 @@ public abstract class KeyAgreementSpi { * if this key agreement is not complete. * @throws ShortBufferException * if the specified buffer is too small for the shared secret. - * @since Android 1.0 */ protected abstract int engineGenerateSecret(byte[] sharedSecret, int offset) throws IllegalStateException, ShortBufferException; /** * Generates the shared secret. - * + * * @param algorithm * the algorithm to for the {@code SecretKey} * @return the shared secret as a {@code SecretKey} of the specified @@ -105,7 +98,6 @@ public abstract class KeyAgreementSpi { * @throws InvalidKeyException * if a {@code SecretKey} with the specified algorithm cannot be * created using the generated shared secret. - * @since Android 1.0 */ protected abstract SecretKey engineGenerateSecret(String algorithm) throws IllegalStateException, NoSuchAlgorithmException, @@ -114,7 +106,7 @@ public abstract class KeyAgreementSpi { /** * Initializes this {@code KeyAgreementSpi} with the specified key and the * specified randomness source. - * + * * @param key * the key to initialize this key agreement. * @param random @@ -122,7 +114,6 @@ public abstract class KeyAgreementSpi { * @throws InvalidKeyException * if the specified key cannot be used to initialize this key * agreement. - * @since Android 1.0 */ protected abstract void engineInit(Key key, SecureRandom random) throws InvalidKeyException; @@ -130,7 +121,7 @@ public abstract class KeyAgreementSpi { /** * Initializes this {@code KeyAgreementSpi} with the specified key, * algorithm parameters and randomness source. - * + * * @param key * the key to initialize this key agreement. * @param params @@ -143,7 +134,6 @@ public abstract class KeyAgreementSpi { * @throws InvalidAlgorithmParameterException * if the specified parameters are invalid for this key * agreement algorithm. - * @since Android 1.0 */ protected abstract void engineInit(Key key, AlgorithmParameterSpec params, SecureRandom random) throws InvalidKeyException, diff --git a/libcore/crypto/src/main/java/javax/crypto/KeyGenerator.java b/libcore/crypto/src/main/java/javax/crypto/KeyGenerator.java index 3243b3947..f1dd3b2fb 100644 --- a/libcore/crypto/src/main/java/javax/crypto/KeyGenerator.java +++ b/libcore/crypto/src/main/java/javax/crypto/KeyGenerator.java @@ -32,8 +32,6 @@ import org.apache.harmony.security.fortress.Engine; /** * This class provides the public API for generating symmetric cryptographic * keys. - * - * @since Android 1.0 */ public class KeyGenerator { @@ -54,14 +52,13 @@ public class KeyGenerator { /** * Creates a new {@code KeyGenerator} instance. - * + * * @param keyGenSpi * the implementation delegate. * @param provider * the implementation provider. * @param algorithm * the name of the algorithm. - * @since Android 1.0 */ protected KeyGenerator(KeyGeneratorSpi keyGenSpi, Provider provider, String algorithm) { @@ -72,9 +69,8 @@ public class KeyGenerator { /** * Returns the name of the key generation algorithm. - * + * * @return the name of the key generation algorithm. - * @since Android 1.0 */ public final String getAlgorithm() { return algorithm; @@ -82,9 +78,8 @@ public class KeyGenerator { /** * Returns the provider of this {@code KeyGenerator} instance. - * + * * @return the provider of this {@code KeyGenerator} instance. - * @since Android 1.0 */ public final Provider getProvider() { return provider; @@ -93,7 +88,7 @@ public class KeyGenerator { /** * Creates a new {@code KeyGenerator} instance that provides the specified * key algorithm, - * + * * @param algorithm * the name of the requested key algorithm * @return the new {@code KeyGenerator} instance. @@ -101,7 +96,6 @@ public class KeyGenerator { * if the specified algorithm is not available by any provider. * @throws NullPointerException * if {@code algorithm} is {@code null}. - * @since Android 1.0 */ public static final KeyGenerator getInstance(String algorithm) throws NoSuchAlgorithmException { @@ -118,7 +112,7 @@ public class KeyGenerator { /** * Creates a new {@code KeyGenerator} instance that provides the specified * key algorithm from the specified provider. - * + * * @param algorithm * the name of the requested key algorithm. * @param provider @@ -133,7 +127,6 @@ public class KeyGenerator { * if the specified provider is name is {@code null} or empty. * @throws NullPointerException * if the specified algorithm name is {@code null}. - * @since Android 1.0 */ public static final KeyGenerator getInstance(String algorithm, String provider) throws NoSuchAlgorithmException, @@ -151,7 +144,7 @@ public class KeyGenerator { /** * Creates a new {@code KeyGenerator} instance that provides the specified * key algorithm from the specified provider. - * + * * @param algorithm * the name of the requested key algorithm. * @param provider @@ -164,7 +157,6 @@ public class KeyGenerator { * if the specified provider is {@code null}. * @throws NullPointerException * if the specified algorithm name is {@code null}. - * @since Android 1.0 */ public static final KeyGenerator getInstance(String algorithm, Provider provider) throws NoSuchAlgorithmException { @@ -183,9 +175,8 @@ public class KeyGenerator { /** * Generates a secret key. - * + * * @return the generated secret key. - * @since Android 1.0 */ public final SecretKey generateKey() { return spiImpl.engineGenerateKey(); @@ -194,13 +185,12 @@ public class KeyGenerator { /** * Initializes this {@code KeyGenerator} instance with the specified * algorithm parameters. - * + * * @param params * the parameters for the key generation algorithm. * @throws InvalidAlgorithmParameterException * if the parameters cannot be used to initialize this key * generator algorithm. - * @since Android 1.0 */ public final void init(AlgorithmParameterSpec params) throws InvalidAlgorithmParameterException { @@ -210,7 +200,7 @@ public class KeyGenerator { /** * Initializes this {@code KeyGenerator} instance with the specified * algorithm parameters and randomness source. - * + * * @param params * the parameters for the key generation algorithm. * @param random @@ -218,7 +208,6 @@ public class KeyGenerator { * @throws InvalidAlgorithmParameterException * if the parameters cannot be uses to initialize this key * generator algorithm. - * @since Android 1.0 */ public final void init(AlgorithmParameterSpec params, SecureRandom random) throws InvalidAlgorithmParameterException { @@ -228,10 +217,9 @@ public class KeyGenerator { /** * Initializes this {@code KeyGenerator} instance for the specified key size * (in bits). - * + * * @param keysize * the size of the key (in bits). - * @since Android 1.0 */ public final void init(int keysize) { spiImpl.engineInit(keysize, rndm);//new SecureRandom()); @@ -240,12 +228,11 @@ public class KeyGenerator { /** * Initializes this {@code KeyGenerator} instance for the specified key size * (in bits) using the specified randomness source. - * + * * @param keysize * the size of the key (in bits). * @param random * the randomness source for any random bytes. - * @since Android 1.0 */ public final void init(int keysize, SecureRandom random) { spiImpl.engineInit(keysize, random); @@ -254,10 +241,9 @@ public class KeyGenerator { /** * Initializes this {@code KeyGenerator} with the specified randomness * source. - * + * * @param random * the randomness source for any random bytes. - * @since Android 1.0 */ public final void init(SecureRandom random) { spiImpl.engineInit(random); diff --git a/libcore/crypto/src/main/java/javax/crypto/KeyGeneratorSpi.java b/libcore/crypto/src/main/java/javax/crypto/KeyGeneratorSpi.java index 165db6986..edbbe4321 100644 --- a/libcore/crypto/src/main/java/javax/crypto/KeyGeneratorSpi.java +++ b/libcore/crypto/src/main/java/javax/crypto/KeyGeneratorSpi.java @@ -26,30 +26,26 @@ import java.security.spec.AlgorithmParameterSpec; * {@code KeyGenerator} class. * * @see KeyGenerator - * @since Android 1.0 */ public abstract class KeyGeneratorSpi { /** * Creates a new {@code KeyGeneratorSpi} instance. - * - * @since Android 1.0 */ public KeyGeneratorSpi() { } /** * Generates a secret key. - * + * * @return the generated secret key. - * @since Android 1.0 */ protected abstract SecretKey engineGenerateKey(); /** * Initializes this {@code KeyGeneratorSpi} instance with the specified * algorithm parameters and randomness source. - * + * * @param params * the parameters for the key generation algorithm. * @param random @@ -57,7 +53,6 @@ public abstract class KeyGeneratorSpi { * @throws InvalidAlgorithmParameterException * if the parameters cannot be uses to initialize this key * generator algorithm. - * @since Android 1.0 */ protected abstract void engineInit(AlgorithmParameterSpec params, SecureRandom random) throws InvalidAlgorithmParameterException; @@ -65,22 +60,20 @@ public abstract class KeyGeneratorSpi { /** * Initializes this {@code KeyGenerator} instance for the specified key * size (in bits) using the specified randomness source. - * + * * @param keysize * the size of the key (in bits). * @param random * the randomness source for any random bytes. - * @since Android 1.0 */ protected abstract void engineInit(int keysize, SecureRandom random); /** * Initializes this {@code KeyGenerator} with the specified randomness * source. - * + * * @param random * the randomness source for any random bytes. - * @since Android 1.0 */ protected abstract void engineInit(SecureRandom random); } \ No newline at end of file diff --git a/libcore/crypto/src/main/java/javax/crypto/Mac.java b/libcore/crypto/src/main/java/javax/crypto/Mac.java index 95f453938..94ea20e25 100644 --- a/libcore/crypto/src/main/java/javax/crypto/Mac.java +++ b/libcore/crypto/src/main/java/javax/crypto/Mac.java @@ -34,8 +34,6 @@ import org.apache.harmony.security.fortress.Engine; /** * This class provides the public API for Message Authentication Code * (MAC) algorithms. - * - * @since Android 1.0 */ public class Mac implements Cloneable { @@ -56,14 +54,13 @@ public class Mac implements Cloneable { /** * Creates a new {@code Mac} instance. - * + * * @param macSpi * the implementation delegate. * @param provider * the implementation provider. * @param algorithm * the name of the MAC algorithm. - * @since Android 1.0 */ protected Mac(MacSpi macSpi, Provider provider, String algorithm) { this.provider = provider; @@ -76,7 +73,6 @@ public class Mac implements Cloneable { * Returns the name of the MAC algorithm. * * @return the name of the MAC algorithm. - * @since Android 1.0 */ public final String getAlgorithm() { return algorithm; @@ -84,9 +80,8 @@ public class Mac implements Cloneable { /** * Returns the provider of this {@code Mac} instance. - * + * * @return the provider of this {@code Mac} instance. - * @since Android 1.0 */ public final Provider getProvider() { return provider; @@ -102,8 +97,8 @@ public class Mac implements Cloneable { * @throws NoSuchAlgorithmException * if the specified algorithm is not available by any provider. * @throws NullPointerException - * if {@code algorithm} is {@code null}. - * @since Android 1.0 + * if {@code algorithm} is {@code null} (instead of + * NoSuchAlgorithmException as in 1.4 release). */ public static final Mac getInstance(String algorithm) throws NoSuchAlgorithmException { @@ -133,8 +128,8 @@ public class Mac implements Cloneable { * @throws IllegalArgumentException * if the specified provider name is {@code null} or empty. * @throws NullPointerException - * if {@code algorithm} is {@code null} - * @since Android 1.0. + * if {@code algorithm} is {@code null} (instead of + * NoSuchAlgorithmException as in 1.4 release). */ public static final Mac getInstance(String algorithm, String provider) throws NoSuchAlgorithmException, NoSuchProviderException { @@ -163,8 +158,8 @@ public class Mac implements Cloneable { * @throws IllegalArgumentException * if {@code provider} is {@code null}. * @throws NullPointerException - * if {@code algorithm} is {@code null}. - * @since Android 1.0 + * if {@code algorithm} is {@code null} (instead of + * NoSuchAlgorithmException as in 1.4 release). */ public static final Mac getInstance(String algorithm, Provider provider) throws NoSuchAlgorithmException { @@ -182,7 +177,7 @@ public class Mac implements Cloneable { /** * Returns the length of this MAC (in bytes). - * + * * @return the length of this MAC (in bytes). */ public final int getMacLength() { @@ -192,7 +187,7 @@ public class Mac implements Cloneable { /** * Initializes this {@code Mac} instance with the specified key and * algorithm parameters. - * + * * @param key * the key to initialize this algorithm. * @param params @@ -203,7 +198,6 @@ public class Mac implements Cloneable { * @throws InvalidAlgorithmParameterException * if the specified parameters cannot be used to initialize this * algorithm. - * @since Android 1.0 */ public final void init(Key key, AlgorithmParameterSpec params) throws InvalidKeyException, InvalidAlgorithmParameterException { @@ -216,7 +210,7 @@ public class Mac implements Cloneable { /** * Initializes this {@code Mac} instance with the specified key. - * + * * @param key * the key to initialize this algorithm. * @throws InvalidKeyException @@ -225,7 +219,6 @@ public class Mac implements Cloneable { * @throws RuntimeException * if the specified key cannot be used to initialize this * algorithm. - * @since Android 1.0 */ public final void init(Key key) throws InvalidKeyException { if (key == null) { @@ -241,12 +234,11 @@ public class Mac implements Cloneable { /** * Updates this {@code Mac} instance with the specified byte. - * + * * @param input * the byte * @throws IllegalStateException * if this MAC is not initialized. - * @since Android 1.0 */ public final void update(byte input) throws IllegalStateException { if (!isInitMac) { @@ -258,7 +250,7 @@ public class Mac implements Cloneable { /** * Updates this {@code Mac} instance with the data from the specified buffer * {@code input} from the specified {@code offset} and length {@code len}. - * + * * @param input * the buffer. * @param offset @@ -270,7 +262,6 @@ public class Mac implements Cloneable { * @throws IllegalArgumentException * if {@code offset} and {@code len} do not specified a valid * chunk in {@code input} buffer. - * @since Android 1.0 */ public final void update(byte[] input, int offset, int len) throws IllegalStateException { @@ -288,12 +279,11 @@ public class Mac implements Cloneable { /** * Copies the buffer provided as input for further processing. - * + * * @param input * the buffer. * @throws IllegalStateException * if this MAC is not initialized. - * @since Android 1.0 */ public final void update(byte[] input) throws IllegalStateException { if (!isInitMac) { @@ -308,12 +298,11 @@ public class Mac implements Cloneable { * Updates this {@code Mac} instance with the data from the specified * buffer, starting at {@link ByteBuffer#position()}, including the next * {@link ByteBuffer#remaining()} bytes. - * + * * @param input * the buffer. * @throws IllegalStateException * if this MAC is not initialized. - * @since Android 1.0 */ public final void update(ByteBuffer input) { if (!isInitMac) { @@ -333,12 +322,10 @@ public class Mac implements Cloneable { * This {@code Mac} instance is reverted to its initial state and can be * used to start the next MAC computation with the same parameters or * initialized with different parameters. - *

- * + * * @return the generated digest. * @throws IllegalStateException * if this MAC is not initialized. - * @since Android 1.0 */ public final byte[] doFinal() throws IllegalStateException { if (!isInitMac) { @@ -355,8 +342,7 @@ public class Mac implements Cloneable { * This {@code Mac} instance is reverted to its initial state and can be * used to start the next MAC computation with the same parameters or * initialized with different parameters. - *

- * + * * @param output * the output buffer * @param outOffset @@ -368,7 +354,6 @@ public class Mac implements Cloneable { * of the output buffer. * @throws IllegalStateException * if this MAC is not initialized. - * @since Android 1.0 */ public final void doFinal(byte[] output, int outOffset) throws ShortBufferException, IllegalStateException { @@ -401,14 +386,12 @@ public class Mac implements Cloneable { * This {@code Mac} instance is reverted to its initial state and can be * used to start the next MAC computation with the same parameters or * initialized with different parameters. - *

- * + * * @param input * the final bytes. * @return the generated digest. * @throws IllegalStateException * if this MAC is not initialized. - * @since Android 1.0 */ public final byte[] doFinal(byte[] input) throws IllegalStateException { if (!isInitMac) { @@ -426,9 +409,6 @@ public class Mac implements Cloneable { * This {@code Mac} instance is reverted to its initial state and can be * used to start the next MAC computation with the same parameters or * initialized with different parameters. - *

- * - * @since Android 1.0 */ public final void reset() { spiImpl.engineReset(); @@ -436,11 +416,10 @@ public class Mac implements Cloneable { /** * Clones this {@code Mac} instance and the underlying implementation. - * + * * @return the cloned instance. * @throws CloneNotSupportedException * if the underlying implementation does not support cloning. - * @since Android 1.0 */ @Override public final Object clone() throws CloneNotSupportedException { @@ -449,4 +428,4 @@ public class Mac implements Cloneable { mac.isInitMac = this.isInitMac; return mac; } -} +} \ No newline at end of file diff --git a/libcore/crypto/src/main/java/javax/crypto/MacSpi.java b/libcore/crypto/src/main/java/javax/crypto/MacSpi.java index 475618410..b2683d226 100644 --- a/libcore/crypto/src/main/java/javax/crypto/MacSpi.java +++ b/libcore/crypto/src/main/java/javax/crypto/MacSpi.java @@ -28,30 +28,26 @@ import java.nio.ByteBuffer; * Mac} class. * * @see Mac - * @since Android 1.0 */ public abstract class MacSpi { - + /** * Creates a new {@code MacSpi} instance. - * - * @since Android 1.0 */ public MacSpi() { } /** * Returns the length of this MAC (in bytes). - * + * * @return the length of this MAC (in bytes). - * @since Android 1.0 */ protected abstract int engineGetMacLength(); /** * Initializes this {@code MacSpi} instance with the specified key and * algorithm parameters. - * + * * @param key * the key to initialize this algorithm. * @param params @@ -62,17 +58,15 @@ public abstract class MacSpi { * @throws InvalidAlgorithmParameterException * if the specified parameters cannot be used to initialize this * algorithm. - * @since Android 1.0 */ protected abstract void engineInit(Key key, AlgorithmParameterSpec params) throws InvalidKeyException, InvalidAlgorithmParameterException; /** * Updates this {@code MacSpi} instance with the specified byte. - * + * * @param input * the byte. - * @since Android 1.0 */ protected abstract void engineUpdate(byte input); @@ -80,14 +74,13 @@ public abstract class MacSpi { * Updates this {@code MacSpi} instance with the data from the specified * buffer {@code input} from the specified {@code offset} and length {@code * len}. - * + * * @param input * the buffer. * @param offset * the offset in the buffer. * @param len * the length of the data in the buffer. - * @since Android 1.0 */ protected abstract void engineUpdate(byte[] input, int offset, int len); @@ -95,10 +88,9 @@ public abstract class MacSpi { * Updates this {@code MacSpi} instance with the data from the specified * buffer, starting at {@link ByteBuffer#position()}, including the next * {@link ByteBuffer#remaining()} bytes. - * + * * @param input * the buffer. - * @since Android 1.0 */ protected void engineUpdate(ByteBuffer input) { if (!input.hasRemaining()) { @@ -126,10 +118,8 @@ public abstract class MacSpi { * This {@code MacSpi} instance is reverted to its initial state and * can be used to start the next MAC computation with the same parameters or * initialized with different parameters. - *

- * + * * @return the generated digest. - * @since Android 1.0 */ protected abstract byte[] engineDoFinal(); @@ -139,19 +129,15 @@ public abstract class MacSpi { * This {@code MacSpi} instance is reverted to its initial state and can be * used to start the next MAC computation with the same parameters or * initialized with different parameters. - *

- * - * @since Android 1.0 */ protected abstract void engineReset(); /** * Clones this {@code MacSpi} instance. - * + * * @return the cloned instance. * @throws CloneNotSupportedException * if cloning is not supported. - * @since Android 1.0 */ @Override public Object clone() throws CloneNotSupportedException { diff --git a/libcore/crypto/src/main/java/javax/crypto/NoSuchPaddingException.java b/libcore/crypto/src/main/java/javax/crypto/NoSuchPaddingException.java index 4afb8aba4..55e1f1e4e 100644 --- a/libcore/crypto/src/main/java/javax/crypto/NoSuchPaddingException.java +++ b/libcore/crypto/src/main/java/javax/crypto/NoSuchPaddingException.java @@ -22,8 +22,6 @@ import java.security.GeneralSecurityException; /** * The exception that is thrown when the requested padding mechanism is not * supported. - * - * @since Android 1.0 */ public class NoSuchPaddingException extends GeneralSecurityException { @@ -38,7 +36,6 @@ public class NoSuchPaddingException extends GeneralSecurityException { * * @param msg * the message. - * @since Android 1.0 */ public NoSuchPaddingException(String msg) { super(msg); @@ -46,8 +43,6 @@ public class NoSuchPaddingException extends GeneralSecurityException { /** * Creates a new {@code NoSuchPaddingException}. - * - * @since Android 1.0 */ public NoSuchPaddingException() { } diff --git a/libcore/crypto/src/main/java/javax/crypto/NullCipher.java b/libcore/crypto/src/main/java/javax/crypto/NullCipher.java index 49f96c220..fadf3aee9 100644 --- a/libcore/crypto/src/main/java/javax/crypto/NullCipher.java +++ b/libcore/crypto/src/main/java/javax/crypto/NullCipher.java @@ -32,8 +32,6 @@ import org.apache.harmony.crypto.internal.NullCipherSpi; /** * This class provides an identity cipher that does not transform the input data * in any way. The encrypted data is identical to the plain text. - * - * @since Android 1.0 */ public class NullCipher extends Cipher { diff --git a/libcore/crypto/src/main/java/javax/crypto/SealedObject.java b/libcore/crypto/src/main/java/javax/crypto/SealedObject.java index 4e71453e5..bf453db77 100644 --- a/libcore/crypto/src/main/java/javax/crypto/SealedObject.java +++ b/libcore/crypto/src/main/java/javax/crypto/SealedObject.java @@ -40,19 +40,13 @@ import org.apache.harmony.crypto.internal.nls.Messages; *

* Since a {@code SealedObject} instance is a serializable object itself it can * either be stored or transmitted over an insecure channel. - *

+ *

* The wrapped object can later be decrypted (unsealed) using the corresponding * key and then be deserialized to retrieve the original object.The sealed * object itself keeps track of the cipher and corresponding parameters. - * - * @since Android 1.0 */ public class SealedObject implements Serializable { - // the value of this field was derived by using serialver utility - /** - * @com.intel.drl.spec_ref - */ private static final long serialVersionUID = 4482838265551344752L; /** @@ -76,8 +70,7 @@ public class SealedObject implements Serializable { * and sealing it using the specified cipher. *

* The cipher must be fully initialized. - *

- * + * * @param object * the object to seal, can be {@code null}. * @param c @@ -90,7 +83,6 @@ public class SealedObject implements Serializable { * size. * @throws NullPointerException * if the cipher is {@code null}. - * @since Android 1.0 */ public SealedObject(Serializable object, Cipher c) throws IOException, IllegalBlockSizeException { @@ -117,10 +109,9 @@ public class SealedObject implements Serializable { /** * Creates a new {@code SealedObject} instance by copying the data from * the specified object. - * + * * @param so * the object to copy. - * @since Android 1.0 */ protected SealedObject(SealedObject so) { if (so == null) { @@ -134,9 +125,8 @@ public class SealedObject implements Serializable { /** * Returns the algorithm this object was sealed with. - * + * * @return the algorithm this object was sealed with. - * @since Android 1.0 */ public final String getAlgorithm() { return sealAlg; @@ -144,7 +134,7 @@ public class SealedObject implements Serializable { /** * Returns the wrapped object, decrypting it using the specified key. - * + * * @param key * the key to decrypt the data with. * @return the encapsulated object. @@ -156,7 +146,6 @@ public class SealedObject implements Serializable { * if the algorithm to decrypt the data is not available. * @throws InvalidKeyException * if the specified key cannot be used to decrypt the data. - * @since Android 1.0 */ public final Object getObject(Key key) throws IOException, ClassNotFoundException, @@ -207,7 +196,7 @@ public class SealedObject implements Serializable { /** * Returns the wrapped object, decrypting it using the specified * cipher. - * + * * @param c * the cipher to decrypt the data. * @return the encapsulated object. @@ -221,7 +210,6 @@ public class SealedObject implements Serializable { * size. * @throws BadPaddingException * if the padding of the data does not match the padding scheme. - * @since Android 1.0 */ public final Object getObject(Cipher c) throws IOException, ClassNotFoundException, @@ -239,7 +227,7 @@ public class SealedObject implements Serializable { /** * Returns the wrapped object, decrypting it using the specified key. The * specified provider is used to retrieve the cipher algorithm. - * + * * @param key * the key to decrypt the data. * @param provider @@ -255,7 +243,6 @@ public class SealedObject implements Serializable { * if the specified provider is not available. * @throws InvalidKeyException * if the specified key cannot be used to decrypt the data. - * @since Android 1.0 */ public final Object getObject(Key key, String provider) throws IOException, ClassNotFoundException, diff --git a/libcore/crypto/src/main/java/javax/crypto/SecretKey.java b/libcore/crypto/src/main/java/javax/crypto/SecretKey.java index 102f8887f..ac6107443 100644 --- a/libcore/crypto/src/main/java/javax/crypto/SecretKey.java +++ b/libcore/crypto/src/main/java/javax/crypto/SecretKey.java @@ -24,21 +24,18 @@ import java.security.Key; *

* This interface is a marker interface to group secret keys and to * provide type safety for. - *

+ *

* Implementations of this interface have to overwrite the * {@link Object#equals(Object) equals} and {@link Object#hashCode() hashCode} * from {@link java.lang.Object} so comparison is done using the actual key data * and not the object reference. - * - * @since Android 1.0 */ public interface SecretKey extends Key { /** * The serialization version identifier. - * + * * @serial - * @since Android 1.0 */ public static final long serialVersionUID = -4795878709595146952L; } \ No newline at end of file diff --git a/libcore/crypto/src/main/java/javax/crypto/SecretKeyFactory.java b/libcore/crypto/src/main/java/javax/crypto/SecretKeyFactory.java index a420dab7a..57bca3ec7 100644 --- a/libcore/crypto/src/main/java/javax/crypto/SecretKeyFactory.java +++ b/libcore/crypto/src/main/java/javax/crypto/SecretKeyFactory.java @@ -40,9 +40,6 @@ import org.apache.harmony.security.fortress.Engine; * * Which key specifications are supported by the {@link #generateSecret} and * {@link #getKeySpec} is provider dependent. - *

- * - * @since Android 1.0 */ public class SecretKeyFactory { @@ -60,14 +57,13 @@ public class SecretKeyFactory { /** * Creates a new {@code SecretKeyFactory} - * + * * @param keyFacSpi * the SPI delegate. * @param provider * the provider providing this key factory. * @param algorithm * the algorithm name for the secret key. - * @since Android 1.0 */ protected SecretKeyFactory(SecretKeyFactorySpi keyFacSpi, Provider provider, String algorithm) { @@ -78,9 +74,8 @@ public class SecretKeyFactory { /** * Returns the name of the secret key algorithm. - * + * * @return the name of the secret key algorithm. - * @since Android 1.0 */ public final String getAlgorithm() { return algorithm; @@ -88,9 +83,8 @@ public class SecretKeyFactory { /** * Returns the provider for this {@code SecretKeyFactory} instance. - * + * * @return the provider for this {@code SecretKeyFactory} instance. - * @since Android 1.0 */ public final Provider getProvider() { return provider; @@ -99,7 +93,7 @@ public class SecretKeyFactory { /** * Creates a new {@code SecretKeyFactory} instance for the specified key * algorithm. - * + * * @param algorithm * the name of the key algorithm. * @return a secret key factory for the specified key algorithm. @@ -107,7 +101,6 @@ public class SecretKeyFactory { * if no installed provider can provide the requested algorithm. * @throws NullPointerException * if the specified algorithm is {@code null}. - * @since Android 1.0 */ public static final SecretKeyFactory getInstance(String algorithm) throws NoSuchAlgorithmException { @@ -124,7 +117,7 @@ public class SecretKeyFactory { /** * Creates a new {@code SecretKeyFactory} instance for the specified key * algorithm from the specified {@code provider}. - * + * * @param algorithm * the name of the key algorithm. * @param provider @@ -139,7 +132,6 @@ public class SecretKeyFactory { * if the specified provider does not exist. * @throws IllegalArgumentException * if the specified provider name is {@code null} or empty. - * @since Android 1.0 */ public static final SecretKeyFactory getInstance(String algorithm, String provider) throws NoSuchAlgorithmException, @@ -157,7 +149,7 @@ public class SecretKeyFactory { /** * Creates a new {@code SecretKeyFactory} instance for the specified key * algorithm from the specified provider. - * + * * @param algorithm * the name of the key algorithm. * @param provider @@ -171,7 +163,6 @@ public class SecretKeyFactory { * if the specified provider is {@code null}. * @throws NullPointerException * is the specified algorithm name is {@code null}. - * @since Android 1.0 */ public static final SecretKeyFactory getInstance(String algorithm, Provider provider) throws NoSuchAlgorithmException { @@ -190,14 +181,13 @@ public class SecretKeyFactory { /** * Generate a secret key from the specified key specification. - * + * * @param keySpec * the key specification. * @return a secret key. * @throws InvalidKeySpecException * if the specified key specification cannot be used to generate * a secret key. - * @since Android 1.0 */ public final SecretKey generateSecret(KeySpec keySpec) throws InvalidKeySpecException { @@ -206,7 +196,7 @@ public class SecretKeyFactory { /** * Returns the key specification of the specified secret key. - * + * * @param key * the secret key to get the specification from. * @param keySpec @@ -215,7 +205,6 @@ public class SecretKeyFactory { * @throws InvalidKeySpecException * if the specified secret key cannot be transformed into the * requested key specification. - * @since Android 1.0 */ @SuppressWarnings("unchecked") public final KeySpec getKeySpec(SecretKey key, Class keySpec) @@ -226,14 +215,13 @@ public class SecretKeyFactory { /** * Translates the specified secret key into an instance of the corresponding * key from the provider of this key factory. - * + * * @param key * the secret key to translate. * @return the corresponding translated key. * @throws InvalidKeyException * if the specified key cannot be translated using this key * factory. - * @since Android 1.0 */ public final SecretKey translateKey(SecretKey key) throws InvalidKeyException { diff --git a/libcore/crypto/src/main/java/javax/crypto/SecretKeyFactorySpi.java b/libcore/crypto/src/main/java/javax/crypto/SecretKeyFactorySpi.java index f834dbb4b..5d7764ed8 100644 --- a/libcore/crypto/src/main/java/javax/crypto/SecretKeyFactorySpi.java +++ b/libcore/crypto/src/main/java/javax/crypto/SecretKeyFactorySpi.java @@ -24,35 +24,31 @@ import java.security.spec.KeySpec; /** * The Service Provider Interface (SPI) definition for the {@code * SecretKeyFactory} class. - * - * @since Android 1.0 */ public abstract class SecretKeyFactorySpi { /** * Creates a new {@code SecretKeyFactorySpi} instance. - * @since Android 1.0 */ public SecretKeyFactorySpi() { } /** * Generate a secret key from the specified key specification. - * + * * @param keySpec * the key specification. * @return a secret key. * @throws InvalidKeySpecException * if the specified key specification cannot be used to generate * a secret key. - * @since Android 1.0 */ protected abstract SecretKey engineGenerateSecret(KeySpec keySpec) throws InvalidKeySpecException; /** * Returns the key specification of the specified secret key. - * + * * @param key * the secret key to get the specification from. * @param keySpec @@ -61,7 +57,6 @@ public abstract class SecretKeyFactorySpi { * @throws InvalidKeySpecException * if the specified secret key cannot be transformed into the * requested key specification. - * @since Android 1.0 */ @SuppressWarnings("unchecked") protected abstract KeySpec engineGetKeySpec(SecretKey key, Class keySpec) @@ -70,14 +65,13 @@ public abstract class SecretKeyFactorySpi { /** * Translates the specified secret key into an instance of the corresponding * key from the provider of this key factory. - * + * * @param key * the secret key to translate. * @return the corresponding translated key. * @throws InvalidKeyException * if the specified key cannot be translated using this key * factory. - * @since Android 1.0 */ protected abstract SecretKey engineTranslateKey(SecretKey key) throws InvalidKeyException; diff --git a/libcore/crypto/src/main/java/javax/crypto/ShortBufferException.java b/libcore/crypto/src/main/java/javax/crypto/ShortBufferException.java index 593a31ee6..56480a852 100644 --- a/libcore/crypto/src/main/java/javax/crypto/ShortBufferException.java +++ b/libcore/crypto/src/main/java/javax/crypto/ShortBufferException.java @@ -27,8 +27,6 @@ import java.security.GeneralSecurityException; /** * The exception that is thrown when the result of an operation is attempted to * store in a user provided buffer that is too small. - * - * @since Android 1.0 */ public class ShortBufferException extends GeneralSecurityException { @@ -43,7 +41,6 @@ public class ShortBufferException extends GeneralSecurityException { * * @param msg * the exception message. - * @since Android 1.0 */ public ShortBufferException(String msg) { super(msg); @@ -51,8 +48,6 @@ public class ShortBufferException extends GeneralSecurityException { /** * Creates a new instance of {@code ShortBufferException}. - * - * @since Android 1.0 */ public ShortBufferException() { } diff --git a/libcore/crypto/src/main/java/javax/crypto/interfaces/DHKey.java b/libcore/crypto/src/main/java/javax/crypto/interfaces/DHKey.java index f686844d4..6ef17d406 100644 --- a/libcore/crypto/src/main/java/javax/crypto/interfaces/DHKey.java +++ b/libcore/crypto/src/main/java/javax/crypto/interfaces/DHKey.java @@ -21,14 +21,12 @@ import javax.crypto.spec.DHParameterSpec; /** * The interface for a Diffie-Hellman key. - * - * @since Android 1.0 */ public interface DHKey { /** * Returns the parameters for this key. - * + * * @return the parameters for this key. */ public DHParameterSpec getParams(); diff --git a/libcore/crypto/src/main/java/javax/crypto/interfaces/DHPrivateKey.java b/libcore/crypto/src/main/java/javax/crypto/interfaces/DHPrivateKey.java index d39268b81..f63e0cb5e 100644 --- a/libcore/crypto/src/main/java/javax/crypto/interfaces/DHPrivateKey.java +++ b/libcore/crypto/src/main/java/javax/crypto/interfaces/DHPrivateKey.java @@ -22,8 +22,6 @@ import java.security.PrivateKey; /** * The interface for a private key in the Diffie-Hellman key exchange protocol. - * - * @since Android 1.0 */ public interface DHPrivateKey extends DHKey, PrivateKey { diff --git a/libcore/crypto/src/main/java/javax/crypto/interfaces/DHPublicKey.java b/libcore/crypto/src/main/java/javax/crypto/interfaces/DHPublicKey.java index 75201a745..92e8f10f1 100644 --- a/libcore/crypto/src/main/java/javax/crypto/interfaces/DHPublicKey.java +++ b/libcore/crypto/src/main/java/javax/crypto/interfaces/DHPublicKey.java @@ -21,9 +21,7 @@ import java.math.BigInteger; import java.security.PublicKey; /** - * The interface for a public key in the Diffie-Hellman key exchange protocol. - * - * @since Android 1.0 + * The interface for a public key in the Diffie-Hellman key exchange protocol. */ public interface DHPublicKey extends DHKey, PublicKey { diff --git a/libcore/crypto/src/main/java/javax/crypto/interfaces/PBEKey.java b/libcore/crypto/src/main/java/javax/crypto/interfaces/PBEKey.java index 4612ad2d1..c718715e9 100644 --- a/libcore/crypto/src/main/java/javax/crypto/interfaces/PBEKey.java +++ b/libcore/crypto/src/main/java/javax/crypto/interfaces/PBEKey.java @@ -21,8 +21,6 @@ import javax.crypto.SecretKey; /** * The interface to a password-based-encryption key. - * - * @since Android 1.0 */ public interface PBEKey extends SecretKey { @@ -33,21 +31,21 @@ public interface PBEKey extends SecretKey { /** * Returns the iteration count, 0 if not specified. - * + * * @return the iteration count, 0 if not specified. */ public int getIterationCount(); /** * Returns a copy of the salt data or null if not specified. - * + * * @return a copy of the salt data or null if not specified. */ public byte[] getSalt(); /** * Returns a copy to the password. - * + * * @return a copy to the password. */ public char[] getPassword(); diff --git a/libcore/crypto/src/main/java/javax/crypto/spec/DESKeySpec.java b/libcore/crypto/src/main/java/javax/crypto/spec/DESKeySpec.java index 2a994d5ab..372a68d00 100644 --- a/libcore/crypto/src/main/java/javax/crypto/spec/DESKeySpec.java +++ b/libcore/crypto/src/main/java/javax/crypto/spec/DESKeySpec.java @@ -24,8 +24,6 @@ import org.apache.harmony.crypto.internal.nls.Messages; /** * The key specification for a DES key. - * - * @since Android 1.0 */ public class DESKeySpec implements KeySpec { @@ -96,7 +94,7 @@ public class DESKeySpec implements KeySpec { /** * Creates a new DESKeySpec from the first 8 bytes of the * specified key data. - * + * * @param key * the key data. * @throws InvalidKeyException @@ -109,7 +107,7 @@ public class DESKeySpec implements KeySpec { /** * Creates a new DESKeySpec from the first 8 bytes of the * specified key data starting at offset. - * + * * @param key * the key data * @param offset @@ -133,7 +131,7 @@ public class DESKeySpec implements KeySpec { /** * Returns a copy of the key. - * + * * @return a copy of the key. */ public byte[] getKey() { @@ -145,7 +143,7 @@ public class DESKeySpec implements KeySpec { /** * Returns whether the specified key data starting at offset is * parity-adjusted. - * + * * @param key * the key data. * @param offset @@ -185,7 +183,7 @@ public class DESKeySpec implements KeySpec { /** * Returns whether the specified key data starting at offset is * weak or semi-weak. - * + * * @param key * the key data. * @param offset diff --git a/libcore/crypto/src/main/java/javax/crypto/spec/DESedeKeySpec.java b/libcore/crypto/src/main/java/javax/crypto/spec/DESedeKeySpec.java index 186f07dcd..199eba6c0 100644 --- a/libcore/crypto/src/main/java/javax/crypto/spec/DESedeKeySpec.java +++ b/libcore/crypto/src/main/java/javax/crypto/spec/DESedeKeySpec.java @@ -24,8 +24,6 @@ import org.apache.harmony.crypto.internal.nls.Messages; /** * The key specification for a triple-DES (DES-EDE) key. - * - * @since Android 1.0 */ public class DESedeKeySpec implements KeySpec { @@ -39,7 +37,7 @@ public class DESedeKeySpec implements KeySpec { /** * 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 @@ -64,7 +62,7 @@ public class DESedeKeySpec implements KeySpec { * 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 @@ -90,7 +88,7 @@ public class DESedeKeySpec implements KeySpec { /** * Returns a copy of the key. - * + * * @return a copy of the key. */ public byte[] getKey() { @@ -102,7 +100,7 @@ public class DESedeKeySpec implements KeySpec { /** * Returns whether the specified key data starting at offset is * parity-adjusted. - * + * * @param key * the key data. * @param offset diff --git a/libcore/crypto/src/main/java/javax/crypto/spec/DHGenParameterSpec.java b/libcore/crypto/src/main/java/javax/crypto/spec/DHGenParameterSpec.java index a14931801..f6ddc035c 100644 --- a/libcore/crypto/src/main/java/javax/crypto/spec/DHGenParameterSpec.java +++ b/libcore/crypto/src/main/java/javax/crypto/spec/DHGenParameterSpec.java @@ -22,8 +22,6 @@ import java.security.spec.AlgorithmParameterSpec; /** * The algorithm parameter specification for generating Diffie-Hellman * parameters used in Diffie-Hellman key agreement. - * - * @since Android 1.0 */ public class DHGenParameterSpec implements AlgorithmParameterSpec { @@ -33,7 +31,7 @@ public class DHGenParameterSpec implements AlgorithmParameterSpec { /** * Creates a new DHGenParameterSpec instance with the specified * parameters. - * + * * @param primeSize * the size of the prime modulus in bits. * @param exponentSize @@ -46,7 +44,7 @@ public class DHGenParameterSpec implements AlgorithmParameterSpec { /** * Returns the size of the prime modulus in bits. - * + * * @return the size of the prime modulus in bits. */ public int getPrimeSize() { @@ -55,7 +53,7 @@ public class DHGenParameterSpec implements AlgorithmParameterSpec { /** * Returns the size of the random exponent in bits. - * + * * @return the size of the random exponent in bits. */ public int getExponentSize() { diff --git a/libcore/crypto/src/main/java/javax/crypto/spec/DHParameterSpec.java b/libcore/crypto/src/main/java/javax/crypto/spec/DHParameterSpec.java index 9bb94b515..6030b404b 100644 --- a/libcore/crypto/src/main/java/javax/crypto/spec/DHParameterSpec.java +++ b/libcore/crypto/src/main/java/javax/crypto/spec/DHParameterSpec.java @@ -22,8 +22,6 @@ import java.security.spec.AlgorithmParameterSpec; /** * The algorithm parameter specification for the Diffie-Hellman algorithm. - * - * @since Android 1.0 */ public class DHParameterSpec implements AlgorithmParameterSpec { @@ -34,7 +32,7 @@ public class DHParameterSpec implements AlgorithmParameterSpec { /** * Creates a new DHParameterSpec instance with the specified * prime modulus and base generator. - * + * * @param p * the prime modulus. * @param g @@ -50,7 +48,7 @@ public class DHParameterSpec implements AlgorithmParameterSpec { * 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 @@ -66,7 +64,7 @@ public class DHParameterSpec implements AlgorithmParameterSpec { /** * Returns the prime modulus of this parameter specification. - * + * * @return the prime modulus. */ public BigInteger getP() { @@ -75,7 +73,7 @@ public class DHParameterSpec implements AlgorithmParameterSpec { /** * Returns the base generator of this parameter specification. - * + * * @return the base generator. */ public BigInteger getG() { @@ -84,7 +82,7 @@ public class DHParameterSpec implements AlgorithmParameterSpec { /** * Returns the size (in bits) of the random exponent. - * + * * @return the size (in bits) of the random exponent. */ public int getL() { diff --git a/libcore/crypto/src/main/java/javax/crypto/spec/DHPrivateKeySpec.java b/libcore/crypto/src/main/java/javax/crypto/spec/DHPrivateKeySpec.java index 6652de86f..925a00378 100644 --- a/libcore/crypto/src/main/java/javax/crypto/spec/DHPrivateKeySpec.java +++ b/libcore/crypto/src/main/java/javax/crypto/spec/DHPrivateKeySpec.java @@ -22,8 +22,6 @@ import java.security.spec.KeySpec; /** * The key specification for a Diffie-Hellman private key. - * - * @since Android 1.0 */ public class DHPrivateKeySpec implements KeySpec { @@ -35,7 +33,7 @@ public class DHPrivateKeySpec implements KeySpec { * Creates a new DHPrivateKeySpec with the specified private * value x. prime modulus p and base * generator g. - * + * * @param x * the private value. * @param p @@ -51,7 +49,7 @@ public class DHPrivateKeySpec implements KeySpec { /** * Returns the private value x. - * + * * @return the private value x. */ public BigInteger getX() { @@ -60,7 +58,7 @@ public class DHPrivateKeySpec implements KeySpec { /** * Returns the prime modulus p. - * + * * @return the prime modulus p. */ public BigInteger getP() { @@ -69,10 +67,11 @@ public class DHPrivateKeySpec implements KeySpec { /** * Returns the base generator g. - * + * * @return the base generator g. */ public BigInteger getG() { return g; } } + diff --git a/libcore/crypto/src/main/java/javax/crypto/spec/DHPublicKeySpec.java b/libcore/crypto/src/main/java/javax/crypto/spec/DHPublicKeySpec.java index 68d3267f7..a5d4461a9 100644 --- a/libcore/crypto/src/main/java/javax/crypto/spec/DHPublicKeySpec.java +++ b/libcore/crypto/src/main/java/javax/crypto/spec/DHPublicKeySpec.java @@ -22,8 +22,6 @@ import java.security.spec.KeySpec; /** * The key specification for a Diffie-Hellman public key. - * - * @since Android 1.0 */ public class DHPublicKeySpec implements KeySpec { @@ -35,7 +33,7 @@ public class DHPublicKeySpec implements KeySpec { * 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 @@ -51,7 +49,7 @@ public class DHPublicKeySpec implements KeySpec { /** * Returns the public value y. - * + * * @return the public value y. */ public BigInteger getY() { @@ -60,7 +58,7 @@ public class DHPublicKeySpec implements KeySpec { /** * Returns the prime modulus p. - * + * * @return the prime modulus p. */ public BigInteger getP() { @@ -69,7 +67,7 @@ public class DHPublicKeySpec implements KeySpec { /** * Returns the base generator g; - * + * * @return the base generator g; */ public BigInteger getG() { diff --git a/libcore/crypto/src/main/java/javax/crypto/spec/IvParameterSpec.java b/libcore/crypto/src/main/java/javax/crypto/spec/IvParameterSpec.java index 2f532a816..ce7f9d3c4 100644 --- a/libcore/crypto/src/main/java/javax/crypto/spec/IvParameterSpec.java +++ b/libcore/crypto/src/main/java/javax/crypto/spec/IvParameterSpec.java @@ -35,7 +35,7 @@ public class IvParameterSpec implements AlgorithmParameterSpec { /** * 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 @@ -53,7 +53,7 @@ public class IvParameterSpec implements AlgorithmParameterSpec { * 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 @@ -81,7 +81,7 @@ public class IvParameterSpec implements AlgorithmParameterSpec { /** * Returns a copy of the initialization vector data. - * + * * @return a copy of the initialization vector data. */ public byte[] getIV() { diff --git a/libcore/crypto/src/main/java/javax/crypto/spec/OAEPParameterSpec.java b/libcore/crypto/src/main/java/javax/crypto/spec/OAEPParameterSpec.java index ebb6cce14..29b572d8d 100644 --- a/libcore/crypto/src/main/java/javax/crypto/spec/OAEPParameterSpec.java +++ b/libcore/crypto/src/main/java/javax/crypto/spec/OAEPParameterSpec.java @@ -26,8 +26,6 @@ import javax.crypto.spec.PSource; *

* This padding algorithm is defined in the PKCS #1 standard. - * - * @since Android 1.0 */ public class OAEPParameterSpec implements AlgorithmParameterSpec { @@ -60,7 +58,7 @@ public class OAEPParameterSpec implements AlgorithmParameterSpec { * 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 @@ -87,7 +85,7 @@ public class OAEPParameterSpec implements AlgorithmParameterSpec { /** * Returns the algorithm name of the message digest. - * + * * @return the algorithm name of the message digest. */ public String getDigestAlgorithm() { @@ -96,7 +94,7 @@ public class OAEPParameterSpec implements AlgorithmParameterSpec { /** * Returns the algorithm name of the mask generation function. - * + * * @return the algorithm name of the mask generation function. */ public String getMGFAlgorithm() { @@ -106,7 +104,7 @@ public class OAEPParameterSpec implements AlgorithmParameterSpec { /** * Returns the algorithm parameter specification for the mask generation * function algorithm. - * + * * @return the algorithm parameter specification for the mask generation * function algorithm. */ @@ -116,7 +114,7 @@ public class OAEPParameterSpec implements AlgorithmParameterSpec { /** * Returns the source of the label L. - * + * * @return the source of the label L. */ public PSource getPSource() { diff --git a/libcore/crypto/src/main/java/javax/crypto/spec/PBEKeySpec.java b/libcore/crypto/src/main/java/javax/crypto/spec/PBEKeySpec.java index c46617e0a..d79fd3c63 100644 --- a/libcore/crypto/src/main/java/javax/crypto/spec/PBEKeySpec.java +++ b/libcore/crypto/src/main/java/javax/crypto/spec/PBEKeySpec.java @@ -27,8 +27,6 @@ import org.apache.harmony.crypto.internal.nls.Messages; *

* Password based encryption is described in PKCS #5. - * - * @since Android 1.0 */ public class PBEKeySpec implements KeySpec { @@ -39,7 +37,7 @@ public class PBEKeySpec implements KeySpec { /** * Creates a new PBEKeySpec with the specified password. - * + * * @param password * the password. */ @@ -58,7 +56,7 @@ public class PBEKeySpec implements KeySpec { /** * 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 @@ -104,7 +102,7 @@ public class PBEKeySpec implements KeySpec { /** * Creates a new PBEKeySpec with the specified password, salt * and iteration count. - * + * * @param password * the password. * @param salt @@ -150,7 +148,7 @@ public class PBEKeySpec implements KeySpec { /** * 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. @@ -166,7 +164,7 @@ public class PBEKeySpec implements KeySpec { /** * 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. */ @@ -181,7 +179,7 @@ public class PBEKeySpec implements KeySpec { /** * Returns the iteration count of this key specification. - * + * * @return the iteration count of this key specification. */ public final int getIterationCount() { @@ -190,7 +188,7 @@ public class PBEKeySpec implements KeySpec { /** * Returns the desired key length of the derived key. - * + * * @return the desired key length of the derived key. */ public final int getKeyLength() { diff --git a/libcore/crypto/src/main/java/javax/crypto/spec/PBEParameterSpec.java b/libcore/crypto/src/main/java/javax/crypto/spec/PBEParameterSpec.java index 190986eff..cce3832ce 100644 --- a/libcore/crypto/src/main/java/javax/crypto/spec/PBEParameterSpec.java +++ b/libcore/crypto/src/main/java/javax/crypto/spec/PBEParameterSpec.java @@ -23,12 +23,10 @@ import org.apache.harmony.crypto.internal.nls.Messages; /** * The algorithm parameter specification for a password based encryption - * algorithm. + * algorithm. *

* Password based encryption is described in PKCS #5. - * - * @since Android 1.0 * */ public class PBEParameterSpec implements AlgorithmParameterSpec { @@ -39,7 +37,7 @@ public class PBEParameterSpec implements AlgorithmParameterSpec { /** * Creates a new PBEParameterSpec with the specified salt and * iteration count. - * + * * @param salt * the salt. * @param iterationCount @@ -58,7 +56,7 @@ public class PBEParameterSpec implements AlgorithmParameterSpec { /** * Returns a copy to the salt. - * + * * @return a copy to the salt. */ public byte[] getSalt() { @@ -69,7 +67,7 @@ public class PBEParameterSpec implements AlgorithmParameterSpec { /** * Returns the iteration count. - * + * * @return the iteration count. */ public int getIterationCount() { diff --git a/libcore/crypto/src/main/java/javax/crypto/spec/PSource.java b/libcore/crypto/src/main/java/javax/crypto/spec/PSource.java index d5bdf1b15..30fd8af49 100644 --- a/libcore/crypto/src/main/java/javax/crypto/spec/PSource.java +++ b/libcore/crypto/src/main/java/javax/crypto/spec/PSource.java @@ -22,8 +22,6 @@ import org.apache.harmony.crypto.internal.nls.Messages; /** * The source of the label L as specified in PKCS #1. - * - * @since Android 1.0 */ public class PSource { @@ -34,7 +32,7 @@ public class PSource { /** * Creates a new PSource instance with the specified source * algorithm identifier. - * + * * @param pSrcName * the source algorithm identifier. * @throws NullPointerException @@ -49,7 +47,7 @@ public class PSource { /** * Returns the source algorithm identifier. - * + * * @return the source algorithm identifier. */ public String getAlgorithm() { @@ -59,15 +57,14 @@ public class PSource { /** * The explicit specification of the parameter P used in the * source algorithm. - * - * @since Android 1.0 */ public static final class PSpecified extends PSource { private final byte[] p; /** - * The instance of PSpecified with the default value byte[0] for P + * The instance of PSpecified with the default value + * byte[0] for P */ public static final PSpecified DEFAULT = new PSpecified(); @@ -79,7 +76,7 @@ public class PSource { /** * Creates a new instance of PSpecified with the specified * parameter P. - * + * * @param p * the parameter P. * @throws NullPointerException @@ -98,7 +95,7 @@ public class PSource { /** * Returns a copy of the value of the parameter P. - * + * * @return a copy of the value of the parameter P */ public byte[] getValue() { diff --git a/libcore/crypto/src/main/java/javax/crypto/spec/RC2ParameterSpec.java b/libcore/crypto/src/main/java/javax/crypto/spec/RC2ParameterSpec.java index bd76cf45d..bc7a39cab 100644 --- a/libcore/crypto/src/main/java/javax/crypto/spec/RC2ParameterSpec.java +++ b/libcore/crypto/src/main/java/javax/crypto/spec/RC2ParameterSpec.java @@ -25,8 +25,6 @@ import org.apache.harmony.crypto.internal.nls.Messages; /** * The algorithm parameter specification for the RC2 algorithm. - * - * @since Android 1.0 */ public class RC2ParameterSpec implements AlgorithmParameterSpec { @@ -36,7 +34,7 @@ public class RC2ParameterSpec implements AlgorithmParameterSpec { /** * Creates a new RC2ParameterSpec instance with the specified * effective key length (in bits), - * + * * @param effectiveKeyBits * the effective key length (in bits). */ @@ -51,7 +49,7 @@ public class RC2ParameterSpec implements AlgorithmParameterSpec { *

* 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 @@ -78,7 +76,7 @@ public class RC2ParameterSpec implements AlgorithmParameterSpec { * 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 @@ -103,7 +101,7 @@ public class RC2ParameterSpec implements AlgorithmParameterSpec { /** * Returns the effective key length (in bits). - * + * * @return the effective key length (in bits). */ public int getEffectiveKeyBits() { @@ -112,7 +110,7 @@ public class RC2ParameterSpec implements AlgorithmParameterSpec { /** * Returns a copy of the initialization vector. - * + * * @return a copy of the initialization vector, or null if none specified. */ public byte[] getIV() { @@ -127,7 +125,7 @@ public class RC2ParameterSpec implements AlgorithmParameterSpec { /** * 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 @@ -148,7 +146,7 @@ public class RC2ParameterSpec implements AlgorithmParameterSpec { /** * Returns the hash code of this RC2ParameterSpec instance. - * + * * @return the hash code. */ @Override diff --git a/libcore/crypto/src/main/java/javax/crypto/spec/RC5ParameterSpec.java b/libcore/crypto/src/main/java/javax/crypto/spec/RC5ParameterSpec.java index f711f41cd..57010f7d5 100644 --- a/libcore/crypto/src/main/java/javax/crypto/spec/RC5ParameterSpec.java +++ b/libcore/crypto/src/main/java/javax/crypto/spec/RC5ParameterSpec.java @@ -25,8 +25,6 @@ import org.apache.harmony.crypto.internal.nls.Messages; /** * The algorithm parameter specification for the RC5 algorithm. - * - * @since Android 1.0 */ public class RC5ParameterSpec implements AlgorithmParameterSpec { @@ -38,7 +36,7 @@ public class RC5ParameterSpec implements AlgorithmParameterSpec { /** * Creates a new RC5ParameterSpec instance with the specified * version, round count an word size (in bits). - * + * * @param version * the version. * @param rounds @@ -61,7 +59,7 @@ public class RC5ParameterSpec implements AlgorithmParameterSpec { * 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 @@ -97,7 +95,7 @@ public class RC5ParameterSpec implements AlgorithmParameterSpec { * 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 @@ -135,7 +133,7 @@ public class RC5ParameterSpec implements AlgorithmParameterSpec { /** * Returns the version. - * + * * @return the version. */ public int getVersion() { @@ -144,7 +142,7 @@ public class RC5ParameterSpec implements AlgorithmParameterSpec { /** * Returns the round count. - * + * * @return the round count. */ public int getRounds() { @@ -153,7 +151,7 @@ public class RC5ParameterSpec implements AlgorithmParameterSpec { /** * Returns the word size (in bits). - * + * * @return the word size (in bits). */ public int getWordSize() { @@ -162,7 +160,7 @@ public class RC5ParameterSpec implements AlgorithmParameterSpec { /** * Returns a copy of the initialization vector. - * + * * @return a copy of the initialization vector, or null if none specified. */ public byte[] getIV() { @@ -177,7 +175,7 @@ public class RC5ParameterSpec implements AlgorithmParameterSpec { /** * 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 @@ -200,7 +198,7 @@ public class RC5ParameterSpec implements AlgorithmParameterSpec { /** * Returns the hash code of this RC5ParameterSpec instance. - * + * * @return the hash code. */ @Override diff --git a/libcore/crypto/src/main/java/javax/crypto/spec/SecretKeySpec.java b/libcore/crypto/src/main/java/javax/crypto/spec/SecretKeySpec.java index 897948c3c..d1eba47cd 100644 --- a/libcore/crypto/src/main/java/javax/crypto/spec/SecretKeySpec.java +++ b/libcore/crypto/src/main/java/javax/crypto/spec/SecretKeySpec.java @@ -33,8 +33,6 @@ import org.apache.harmony.crypto.internal.nls.Messages; * 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[]. - * - * @since Android 1.0 */ public class SecretKeySpec implements SecretKey, KeySpec, Serializable { @@ -50,7 +48,7 @@ public class SecretKeySpec implements SecretKey, KeySpec, Serializable { /** * Creates a new SecretKeySpec for the specified key data and * algorithm name. - * + * * @param key * the key data. * @param algorithm @@ -79,7 +77,7 @@ public class SecretKeySpec implements SecretKey, KeySpec, Serializable { * 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 @@ -120,7 +118,7 @@ public class SecretKeySpec implements SecretKey, KeySpec, Serializable { /** * Returns the algorithm name. - * + * * @return the algorithm name. */ public String getAlgorithm() { @@ -129,7 +127,7 @@ public class SecretKeySpec implements SecretKey, KeySpec, Serializable { /** * Returns the name of the format used to encode the key. - * + * * @return the format name "RAW". */ public String getFormat() { @@ -138,7 +136,7 @@ public class SecretKeySpec implements SecretKey, KeySpec, Serializable { /** * Returns the encoded form of this secret key. - * + * * @return the encoded form of this secret key. */ public byte[] getEncoded() { @@ -149,7 +147,7 @@ public class SecretKeySpec implements SecretKey, KeySpec, Serializable { /** * Returns the hash code of this SecretKeySpec object. - * + * * @return the hash code. */ @Override @@ -164,7 +162,7 @@ public class SecretKeySpec implements SecretKey, KeySpec, Serializable { /** * 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, -- 2.11.0