Merge change 24840 into eclair
* changes:
dalvik: Switch to common cutils sched_policy api
diff --git a/libcore/crypto/src/main/java/javax/crypto/BadPaddingException.java b/libcore/crypto/src/main/java/javax/crypto/BadPaddingException.java
index 19fdaa8..5e2dd38 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 @@
/**
* 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 @@
*
* @param msg
* the message
- * @since Android 1.0
*/
public BadPaddingException(String msg) {
super(msg);
@@ -45,8 +42,6 @@
/**
* 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 ae72226..8e084ae 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 @@
* to be processed at a time can be optionally specified by appending it to the
* mode name. e.g. <i>"AES/CFB8/NoPadding"</i>. If no number is specified, a
* provider specific default value is used.
- * </p>
- *
- * @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 @@
/**
* Creates a new Cipher instance.
- *
+ *
* @param cipherSpi
* the implementation delegate of the cipher.
* @param provider
@@ -157,7 +140,6 @@
* @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 @@
* 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 @@
* @throws NoSuchPaddingException
* if no installed provider can provide the padding scheme in
* the <i>transformation</i>.
- * @since Android 1.0
*/
public static final Cipher getInstance(String transformation)
throws NoSuchAlgorithmException, NoSuchPaddingException {
@@ -199,7 +180,7 @@
/**
* 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 @@
* 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 @@
/**
* 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 @@
* 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 @@
/**
* 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 @@
* <p>
* This is the name of the <i>transformation</i> argument used in the
* {@code getInstance} call creating this object.
- * </p>
- *
+ *
* @return the name of the algorithm of this cipher instance.
- * @since Android 1.0.
*/
public final String getAlgorithm() {
return transformation;
@@ -397,9 +373,8 @@
/**
* 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 @@
/**
* 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 @@
/**
* Returns the <i>initialization vector</i> for this cipher instance.
- *
+ *
* @return the <i>initialization vector</i> for this cipher instance.
- * @since Android 1.0
*/
public final byte[] getIV() {
return spiImpl.engineGetIV();
@@ -440,11 +413,10 @@
* 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 @@
/**
* 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 @@
* The cipher is initialized for the specified operational mode (one of:
* encryption, decryption, key wrapping or key unwrapping) depending on
* {@code opmode}.
- * </p>
+ * <p>
* 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 @@
* 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.
- * </p>
- *
+ *
* @param opmode
* the operation this cipher instance should be initialized for
* (one of: {@code ENCRYPT_MODE}, {@code DECRYPT_MODE}, {@code
@@ -494,7 +464,6 @@
* @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 @@
* The cipher is initialized for the specified operational mode (one of:
* encryption, decryption, key wrapping or key unwrapping) depending on
* {@code opmode}.
- * </p>
+ * <p>
* 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 @@
* 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.
- * </p>
- *
+ *
* @param opmode
* the operation this cipher instance should be initialized for
* (one of: {@code ENCRYPT_MODE}, {@code DECRYPT_MODE}, {@code
@@ -538,7 +506,6 @@
* 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 @@
* <p>
* The cipher is initialized for the specified operational mode (one of:
* encryption, decryption, key wrapping or key unwrapping).
- * </p>
+ * <p>
* 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 @@
* 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.
- * </p>
- *
+ *
* @param opmode
* the operation this cipher instance should be initialized for
* (one of: {@code ENCRYPT_MODE}, {@code DECRYPT_MODE}, {@code
@@ -584,7 +550,6 @@
* @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 @@
* 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 @@
* 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 @@
* The cipher is initialized for the specified operation (one of:
* encryption, decryption, key wrapping or key unwrapping) depending on
* {@code opmode}.
- * </p>
+ * <p>
* 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 @@
* 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.
- * </p>
- *
+ *
* @param opmode
* the operation this cipher instance should be initialized for
* (one of: {@code ENCRYPT_MODE}, {@code DECRYPT_MODE}, {@code
@@ -682,7 +645,6 @@
* @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 @@
* The cipher will be initialized for the specified operation (one of:
* encryption, decryption, key wrapping or key unwrapping) depending on
* {@code opmode}.
- * </p>
+ * <p>
* 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 @@
* 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.
- * </p>
- *
+ *
* @param opmode
* the operation this cipher instance should be initialized for
* (one of: {@code ENCRYPT_MODE}, {@code DECRYPT_MODE}, {@code
@@ -728,7 +689,6 @@
* 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 @@
* 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 @@
* @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 @@
* The cipher will be initialized for the specified operation (one of:
* encryption, decryption, key wrapping or key unwrapping) depending on
* {@code opmode}.
- * </p>
+ * <p>
* It the type of the certificate is X.509 and the certificate has a <i>key
* usage</i> extension field marked as critical, the specified {@code
* opmode} has the be enabled for this key, otherwise an {@code
@@ -806,11 +765,11 @@
* cipher is supposed to generate the required parameters (using its
* provider or random values). Random values are generated using {@code
* random}.
- * </p>
+ * <p>
* 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 @@
* @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 @@
/**
* 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 @@
* 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 @@
/**
* 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 @@
* 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 @@
* a {@code ShortBufferException} is thrown. Use
* {@link Cipher#getOutputSize getOutputSize} to check for the size of the
* output buffer.
- * </p>
- *
+ *
* @param input
* the input bytes to transform.
* @param inputOffset
@@ -969,7 +924,6 @@
* 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 @@
* a {@code ShortBufferException} is thrown. Use
* {@link Cipher#getOutputSize getOutputSize} to check for the size of the
* output buffer.
- * </p>
- *
+ *
* @param input
* the input bytes to transform.
* @param inputOffset
@@ -1006,7 +959,6 @@
* 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 @@
* bytes a {@code ShortBufferException} is thrown. Use
* {@link Cipher#getOutputSize getOutputSize} to check for the size of the
* output buffer.
- * </p>
- *
+ *
* @param input
* the input buffer to transform.
* @param output
@@ -1061,7 +1012,6 @@
* @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 @@
* <p>
* Processes any bytes that may have been buffered in previous {@code
* update} calls.
- * </p>
- *
+ *
* @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 @@
* @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 @@
* <p>
* Processes any bytes that may have been buffered in previous {@code
* update} calls.
- * </p>
+ * <p>
* The final transformed bytes are stored in the {@code output} buffer.
- *
+ *
* @param output
* the output buffer.
* @param outputOffset
@@ -1126,7 +1074,6 @@
* @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 @@
* <p>
* Processes the bytes in {@code input} buffer, and any bytes that have been
* buffered in previous {@code update} calls.
- * </p>
- *
+ *
* @param input
* the input buffer.
* @return the final bytes from the transformation.
@@ -1160,7 +1106,6 @@
* @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 @@
* 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 @@
* @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 @@
* 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 @@
* @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 @@
* Processes the {@code inputLen} bytes in {@code input} buffer at {@code
* inputOffset}, and any bytes that have been buffered in previous {@code
* update} calls.
- * </p>
- *
+ *
* @param input
* the input buffer.
* @param inputOffset
@@ -1281,7 +1223,6 @@
* @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 @@
* {@code input.position()}, and any bytes that have been buffered in
* previous {@code update} calls. The transformed bytes are placed into
* {@code output} buffer.
- * </p>
- *
+ *
* @param input
* the input buffer.
* @param output
@@ -1326,7 +1266,6 @@
* @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 @@
/**
* Wraps a key using this cipher instance.
- *
+ *
* @param key
* the key to wrap.
* @return the wrapped key.
@@ -1355,7 +1294,6 @@
* 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 @@
/**
* Unwraps a key using this cipher instance.
- *
+ *
* @param wrappedKey
* the wrapped key to unwrap.
* @param wrappedKeyAlgorithm
@@ -1386,7 +1324,6 @@
* {@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 @@
/**
* 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 @@
* 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 @@
/**
* 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 @@
* 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 ca64c49..b2c626d 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 @@
* 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.
- * </p>
- *
- * @since Android 1.0
*/
public class CipherInputStream extends FilterInputStream {
@@ -48,12 +45,11 @@
/**
* 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 @@
* InputStream} without a cipher.
* <p>
* A {@code NullCipher} is created and used to process the data.
- * </p>
- *
+ *
* @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 @@
/**
* 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 @@
/**
* 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 @@
* <p>
* if {@code b} is {@code null}, the next {@code len} bytes are read and
* discarded.
- * </p>
- *
+ *
* @param b
* the buffer to be filled with data.
* @param off
@@ -148,7 +139,6 @@
* 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 @@
* 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.
- * </p>
- * 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 @@
}
/**
- * 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 @@
/**
* 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 @@
}
/**
- * 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 8bce42b..1f95b99 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 @@
* 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.
- * </p>
- *
- * @since Android 1.0
*/
public class CipherOutputStream extends FilterOutputStream {
@@ -43,12 +40,11 @@
/**
* 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 @@
* OutputStream} without a cipher.
* <p>
* A {@code NullCipher} is created to process the data.
- * </p>
- *
+ *
* @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 @@
/**
* 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 @@
/**
* 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 @@
/**
* 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 @@
* 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 @@
/**
* Flushes this cipher output stream.
- *
+ *
* @throws IOException
* if an error occurs
*/
@@ -145,7 +136,7 @@
* 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 @@
}
}
}
+
diff --git a/libcore/crypto/src/main/java/javax/crypto/CipherSpi.java b/libcore/crypto/src/main/java/javax/crypto/CipherSpi.java
index f6da929..50fdd49 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 @@
* </ul>
* The following behavior should be implemented for obtaining {@code Cipher}
* instances.
- * </p>
+ * <p>
* When one of the {@link Cipher#getInstance} factory methods is called with a
* <i>transformation</i> that is only an <i>algorithm</i>, check if the provider
* defines a {@code CipherSpi} for "algorithm", if so: return it, otherwise
@@ -76,53 +76,46 @@
* padding name and return it, otherwise throw a
* {@link NoSuchAlgorithmException}.
* </ul>
- * </p>
- *
+ *
* @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 @@
* <p>
* The actual output length of the next call to {@code update} or {@code
* doFinal} may be smaller than the length returned by this method.
- * </p>
- *
+ *
* @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 @@
* 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.
- * </p>
- *
+ *
* @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 @@
* The cipher will be initialized for the specified operation (one of:
* encryption, decryption, key wrapping or key unwrapping) depending on
* {@code opmode}.
- * </p>
+ * <p>
* 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 @@
* 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.
- * </p>
- *
+ *
* @param opmode
* the operation this cipher instance should be initialized for
* (one of: {@code ENCRYPT_MODE}, {@code DECRYPT_MODE}, {@code
@@ -196,7 +183,6 @@
* @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 @@
* The cipher will be initialized for the specified operation (one of:
* encryption, decryption, key wrapping or key unwrapping) depending on
* {@code opmode}.
- * </p>
+ * <p>
* 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 @@
* 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.
- * </p>
- *
+ *
* @param opmode
* the operation this cipher instance should be initialized for
* (one of: {@code ENCRYPT_MODE}, {@code DECRYPT_MODE}, {@code
@@ -235,7 +220,6 @@
* @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 @@
* The cipher will be initialized for the specified operation (one of:
* encryption, decryption, key wrapping or key unwrapping) depending on
* {@code opmode}.
- * </p>
+ * <p>
* 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 @@
* 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.
- * </p>
- *
+ *
* @param opmode
* the operation this cipher instance should be initialized for
* (one of: {@code ENCRYPT_MODE}, {@code DECRYPT_MODE}, {@code
@@ -275,7 +258,6 @@
* @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 @@
/**
* 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 @@
* @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 @@
* a {@code ShortBufferException} is thrown. Use
* {@link Cipher#getOutputSize getOutputSize} to check for the size of the
* output buffer.
- * </p>
- *
+ *
* @param input
* the input bytes to transform.
* @param inputOffset
@@ -327,7 +307,6 @@
* @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 @@
* bytes a {@code ShortBufferException} is thrown. Use
* {@link Cipher#getOutputSize getOutputSize} to check for the size of the
* output buffer.
- * </p>
- *
+ *
* @param input
* the input buffer to transform.
* @param output
@@ -351,7 +329,6 @@
* @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 @@
* Processes the {@code inputLen} bytes in {@code input} buffer at {@code
* inputOffset}, and any bytes that have been buffered in previous {@code
* update} calls.
- * </p>
- *
+ *
* @param input
* the input buffer.
* @param inputOffset
@@ -409,7 +385,6 @@
* 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 @@
* Finishes a multi-part transformation (encryption or decryption).
* <p>
* 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.
- * </p>
- *
+ *
* @param input
* the input buffer.
* @param inputOffset
@@ -440,7 +414,6 @@
* 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 @@
* {@code input.position()}, and any bytes that have been buffered in
* previous {@code update} calls. The transformed bytes are placed into
* {@code output} buffer.
- * </p>
- *
+ *
* @param input
* the input buffer.
* @param output
@@ -519,7 +491,7 @@
* 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 @@
* 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 @@
* 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}.
- * </p>
- *
+ *
* @param wrappedKey
* the wrapped key to unwrap.
* @param wrappedKeyAlgorithm
@@ -559,7 +529,6 @@
* @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 @@
* 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 301cd49..2d0fd25 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 @@
* #8 - Private-Key Information Syntax Standard</a>.
* <p>
* The definition of ASN.1 is as follows:
- * </p>
* <dl>
* EncryptedPrivateKeyInfo ::= SEQUENCE {
* <dd>encryptionAlgorithm AlgorithmIdentifier,</dd>
@@ -57,8 +56,6 @@
* <dd>algorithm OBJECT IDENTIFIER,</dd>
* <dd>parameters ANY DEFINED BY algorithm OPTIONAL }</dd>
* </dl>
- *
- * @since Android 1.0
*/
public class EncryptedPrivateKeyInfo {
// Encryption algorithm name
@@ -75,14 +72,13 @@
/**
* 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 @@
/**
* 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 @@
* null}.
* @throws IllegalArgumentException
* if {@code encryptedData} is empty.
- * @since Android 1.0
*/
public EncryptedPrivateKeyInfo(String encrAlgName, byte[] encryptedData)
throws NoSuchAlgorithmException {
@@ -166,7 +161,7 @@
/**
* 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 @@
* @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 @@
/**
* 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 @@
/**
* 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 @@
/**
* 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 @@
* 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.
- * </p>
- *
+ *
* @param cipher
* the cipher initialized for decrypting the encrypted data.
* @return the extracted {@code PKCS8EncodedKeySpec}.
@@ -252,7 +242,6 @@
* 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 @@
/**
* 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 @@
* data.
* @throws NullPointerException
* if {@code decryptKey} is {@code null}.
- * @since Android 1.0
*/
public PKCS8EncodedKeySpec getKeySpec(Key decryptKey)
throws NoSuchAlgorithmException,
@@ -331,7 +319,7 @@
/**
* 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 @@
* @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 @@
/**
* 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 @@
* 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 @@
/**
* 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 7c68d28..76c88cb 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 @@
/**
* This class implements the functionality of an exemption mechanism such as
* <i>key recovery</i>, <i>key weakening</i>, or <i>key escrow</i>.
- *
- * @since Android 1.0
*/
public class ExemptionMechanism {
@@ -62,14 +60,13 @@
/**
* 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 @@
/**
* 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 @@
/**
* 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 @@
* 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 @@
/**
* 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 @@
* 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 @@
/**
* 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 @@
* 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 @@
/**
* 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 @@
* 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 @@
* @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 @@
* 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 @@
/**
* 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 @@
/**
* 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 @@
* 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 @@
/**
* 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 @@
* 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 @@
/**
* 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 @@
/**
* 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 @@
* 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 @@
/**
* 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 @@
* 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 @@
/**
* 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 3af498b..d094ac3 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 @@
/**
* This is the base class for {@code ExemptionMechanismException}.
- *
- * @since Android 1.0
*/
public class ExemptionMechanismException extends GeneralSecurityException {
@@ -37,7 +35,6 @@
*
* @param msg
* the exception message.
- * @since Android 1.0
*/
public ExemptionMechanismException(String msg) {
super(msg);
@@ -45,8 +42,6 @@
/**
* 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 cef1516..39a27f6 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 @@
/**
* The <i>Service Provider Interface</i> (<b>SPI</b>) 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 @@
/**
* 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 @@
* 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 @@
* 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 @@
/**
* 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 @@
/**
* 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 @@
* 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 @@
/**
* 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 @@
* 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 e376b85..0766b7c 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 @@
/**
* 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 @@
*
* @param msg
* the message
- * @since Android 1.0
*/
public IllegalBlockSizeException(String msg) {
super(msg);
@@ -46,8 +43,6 @@
/**
* 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 ee1f195..593aa37 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 @@
* 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 @@
/**
* Creates a new {@code KeyAgreement} instance.
- *
+ *
* @param keyAgreeSpi
* the <b>SPI</b> 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 @@
/**
* 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 @@
/**
* 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 @@
/**
* 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 @@
* 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 @@
/**
* 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 @@
* 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 @@
/**
* 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 @@
/**
* 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 @@
/**
* 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 @@
* @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 @@
/**
* 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 @@
* @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 @@
/**
* 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 @@
* @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 @@
/**
* 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 @@
* 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 @@
/**
* 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 @@
/**
* 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 @@
* 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 @@
/**
* 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 @@
* @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 fa9f377..5011183 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 @@
/**
* The <i>Service Provider Interface</i> (<b>SPI</b>) 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 @@
/**
* 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 @@
* 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 @@
/**
* 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 @@
* 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 @@
* @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 @@
/**
* 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 @@
* @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 @@
/**
* 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 @@
* @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 3243b39..f1dd3b2 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 @@
/**
* This class provides the public API for generating symmetric cryptographic
* keys.
- *
- * @since Android 1.0
*/
public class KeyGenerator {
@@ -54,14 +52,13 @@
/**
* 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 @@
/**
* 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 @@
/**
* 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 @@
/**
* 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 @@
* 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 @@
/**
* 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 @@
* 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 @@
/**
* 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 @@
* 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 @@
/**
* Generates a secret key.
- *
+ *
* @return the generated secret key.
- * @since Android 1.0
*/
public final SecretKey generateKey() {
return spiImpl.engineGenerateKey();
@@ -194,13 +185,12 @@
/**
* 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 @@
/**
* 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 @@
* @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 @@
/**
* 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 @@
/**
* 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 @@
/**
* 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 165db69..edbbe43 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 @@
* {@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 @@
* @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 @@
/**
* 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 95f4539..94ea20e 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 @@
/**
* This class provides the public API for <i>Message Authentication Code</i>
* (MAC) algorithms.
- *
- * @since Android 1.0
*/
public class Mac implements Cloneable {
@@ -56,14 +54,13 @@
/**
* 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 @@
* 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 @@
/**
* 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 @@
* @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 @@
* @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 @@
* @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 @@
/**
* Returns the length of this MAC (in bytes).
- *
+ *
* @return the length of this MAC (in bytes).
*/
public final int getMacLength() {
@@ -192,7 +187,7 @@
/**
* 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 @@
* @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 @@
/**
* Initializes this {@code Mac} instance with the specified key.
- *
+ *
* @param key
* the key to initialize this algorithm.
* @throws InvalidKeyException
@@ -225,7 +219,6 @@
* @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 @@
/**
* 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 @@
/**
* 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 @@
* @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 @@
/**
* 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 @@
* 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 @@
* 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.
- * </p>
- *
+ *
* @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 @@
* 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.
- * </p>
- *
+ *
* @param output
* the output buffer
* @param outOffset
@@ -368,7 +354,6 @@
* 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 @@
* 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.
- * </p>
- *
+ *
* @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 @@
* 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.
- * </p>
- *
- * @since Android 1.0
*/
public final void reset() {
spiImpl.engineReset();
@@ -436,11 +416,10 @@
/**
* 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 @@
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 4756184..b2683d2 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 @@
* 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 @@
* @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 @@
* 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 @@
* 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 @@
* 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.
- * </p>
- *
+ *
* @return the generated digest.
- * @since Android 1.0
*/
protected abstract byte[] engineDoFinal();
@@ -139,19 +129,15 @@
* 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.
- * </p>
- *
- * @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 4afb8ab..55e1f1e 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 @@
/**
* 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 @@
*
* @param msg
* the message.
- * @since Android 1.0
*/
public NoSuchPaddingException(String msg) {
super(msg);
@@ -46,8 +43,6 @@
/**
* 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 49f96c2..fadf3ae 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 @@
/**
* This class provides an identity cipher that does not transform the input data
* in any way. The <i>encrypted</i> data is identical to the <i>plain text</i>.
- *
- * @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 4e71453..bf453db 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 @@
* <p>
* Since a {@code SealedObject} instance is a serializable object itself it can
* either be stored or transmitted over an insecure channel.
- * </p>
+ * <p>
* 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 @@
* and sealing it using the specified cipher.
* <p>
* The cipher must be fully initialized.
- * </p>
- *
+ *
* @param object
* the object to seal, can be {@code null}.
* @param c
@@ -90,7 +83,6 @@
* 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 @@
/**
* 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 @@
/**
* 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 @@
/**
* 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 @@
* 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 @@
/**
* 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 @@
* 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 @@
/**
* 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 @@
* 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 102f888..ac61074 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 @@
* <p>
* This interface is a <i>marker interface</i> to group secret keys and to
* provide type safety for.
- * </p>
+ * <p>
* 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 a420dab..57bca3e 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 @@
* </ul>
* Which key specifications are supported by the {@link #generateSecret} and
* {@link #getKeySpec} is provider dependent.
- * </p>
- *
- * @since Android 1.0
*/
public class SecretKeyFactory {
@@ -60,14 +57,13 @@
/**
* 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 @@
/**
* 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 @@
/**
* 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 @@
/**
* 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 @@
* 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 @@
/**
* 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 @@
* 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 @@
/**
* 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 @@
* 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 @@
/**
* 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 @@
/**
* 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 @@
* @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 @@
/**
* 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 f834dbb..5d7764e 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 @@
/**
* The <i>Service Provider Interface</i> (<b>SPI</b>) 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 @@
* @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 @@
/**
* 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 593a31e..56480a8 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 @@
/**
* 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 @@
*
* @param msg
* the exception message.
- * @since Android 1.0
*/
public ShortBufferException(String msg) {
super(msg);
@@ -51,8 +48,6 @@
/**
* 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 f686844..6ef17d4 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 @@
/**
* 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 d39268b..f63e0cb 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 @@
/**
* 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 75201a7..92e8f10 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.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 4612ad2..c718715 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 @@
/**
* The interface to a <i>password-based-encryption</i> key.
- *
- * @since Android 1.0
*/
public interface PBEKey extends SecretKey {
@@ -33,21 +31,21 @@
/**
* 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 2a994d5..372a68d 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 @@
/**
* The key specification for a DES key.
- *
- * @since Android 1.0
*/
public class DESKeySpec implements KeySpec {
@@ -96,7 +94,7 @@
/**
* Creates a new <code>DESKeySpec</code> from the first 8 bytes of the
* specified key data.
- *
+ *
* @param key
* the key data.
* @throws InvalidKeyException
@@ -109,7 +107,7 @@
/**
* Creates a new <code>DESKeySpec</code> from the first 8 bytes of the
* specified key data starting at <code>offset</code>.
- *
+ *
* @param key
* the key data
* @param offset
@@ -133,7 +131,7 @@
/**
* Returns a copy of the key.
- *
+ *
* @return a copy of the key.
*/
public byte[] getKey() {
@@ -145,7 +143,7 @@
/**
* Returns whether the specified key data starting at <code>offset</code> is
* <i>parity-adjusted</i>.
- *
+ *
* @param key
* the key data.
* @param offset
@@ -185,7 +183,7 @@
/**
* Returns whether the specified key data starting at <code>offset</code> 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 186f07d..199eba6 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 @@
/**
* The key specification for a triple-DES (DES-EDE) key.
- *
- * @since Android 1.0
*/
public class DESedeKeySpec implements KeySpec {
@@ -39,7 +37,7 @@
/**
* Creates a new <code>DESedeKeySpec</code> instance from the first 24 (
* {@link #DES_EDE_KEY_LEN}) bytes of the specified key data.
- *
+ *
* @param key
* the key data.
* @throws InvalidKeyException
@@ -64,7 +62,7 @@
* Creates a new <code>DESedeKeySpec</code> instance from the first 24 (
* {@link #DES_EDE_KEY_LEN} ) bytes of the specified key data starting at
* <code>offset</code>.
- *
+ *
* @param key
* the key data
* @param offset
@@ -90,7 +88,7 @@
/**
* Returns a copy of the key.
- *
+ *
* @return a copy of the key.
*/
public byte[] getKey() {
@@ -102,7 +100,7 @@
/**
* Returns whether the specified key data starting at <code>offset</code> is
* <i>parity-adjusted</i>.
- *
+ *
* @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 a149318..f6ddc03 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 @@
/**
* 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 @@
/**
* Creates a new <code>DHGenParameterSpec</code> instance with the specified
* parameters.
- *
+ *
* @param primeSize
* the size of the <i>prime modulus</i> in bits.
* @param exponentSize
@@ -46,7 +44,7 @@
/**
* Returns the size of the <i>prime modulus</i> in bits.
- *
+ *
* @return the size of the prime modulus in bits.
*/
public int getPrimeSize() {
@@ -55,7 +53,7 @@
/**
* Returns the size of the <i>random exponent</i> 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 9bb94b5..6030b40 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 @@
/**
* The algorithm parameter specification for the Diffie-Hellman algorithm.
- *
- * @since Android 1.0
*/
public class DHParameterSpec implements AlgorithmParameterSpec {
@@ -34,7 +32,7 @@
/**
* Creates a new <code>DHParameterSpec</code> instance with the specified
* <i>prime modulus</i> and <i>base generator</i>.
- *
+ *
* @param p
* the prime modulus.
* @param g
@@ -50,7 +48,7 @@
* Creates a new <code>DHParameterSpec</code> instance with the specified
* <i>prime modulus</i>, <i>base generator</i> and size (in bits) of the
* <i>random exponent</i>.
- *
+ *
* @param p
* the prime modulus.
* @param g
@@ -66,7 +64,7 @@
/**
* Returns the <i>prime modulus</i> of this parameter specification.
- *
+ *
* @return the prime modulus.
*/
public BigInteger getP() {
@@ -75,7 +73,7 @@
/**
* Returns the <i>base generator</i> of this parameter specification.
- *
+ *
* @return the base generator.
*/
public BigInteger getG() {
@@ -84,7 +82,7 @@
/**
* Returns the size (in bits) of the <i>random exponent</i>.
- *
+ *
* @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 6652de8..925a003 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 @@
/**
* The key specification for a Diffie-Hellman private key.
- *
- * @since Android 1.0
*/
public class DHPrivateKeySpec implements KeySpec {
@@ -35,7 +33,7 @@
* Creates a new <code>DHPrivateKeySpec</code> with the specified <i>private
* value</i> <code>x</code>. <i>prime modulus</i> <code>p</code> and <i>base
* generator</i> <code>g</code>.
- *
+ *
* @param x
* the private value.
* @param p
@@ -51,7 +49,7 @@
/**
* Returns the <i>private value</i> <code>x</code>.
- *
+ *
* @return the private value <code>x</code>.
*/
public BigInteger getX() {
@@ -60,7 +58,7 @@
/**
* Returns the <i>prime modulus</i> <code>p</code>.
- *
+ *
* @return the prime modulus <code>p</code>.
*/
public BigInteger getP() {
@@ -69,10 +67,11 @@
/**
* Returns the <i>base generator</i> <code>g</code>.
- *
+ *
* @return the base generator <code>g</code>.
*/
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 68d3267..a5d4461 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 @@
/**
* The key specification for a Diffie-Hellman public key.
- *
- * @since Android 1.0
*/
public class DHPublicKeySpec implements KeySpec {
@@ -35,7 +33,7 @@
* Creates a new <code>DHPublicKeySpec</code> instance with the specified
* <i>public value</i> <code>y</code>, the <i>prime modulus</i>
* <code>p</code> and the <i>base generator</i> <code>g</code>.
- *
+ *
* @param y
* the public value.
* @param p
@@ -51,7 +49,7 @@
/**
* Returns the <i>public value</i> <code>y</code>.
- *
+ *
* @return the public value <code>y</code>.
*/
public BigInteger getY() {
@@ -60,7 +58,7 @@
/**
* Returns the <i>prime modulus</i> <code>p</code>.
- *
+ *
* @return the prime modulus <code>p</code>.
*/
public BigInteger getP() {
@@ -69,7 +67,7 @@
/**
* Returns the <i>base generator</i> <code>g</code>;
- *
+ *
* @return the base generator <code>g</code>;
*/
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 2f532a8..ce7f9d3 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 @@
/**
* Creates a new <code>IvParameterSpec</code> instance with the bytes from
* the specified buffer <i>iv</i> used as <i>initialization vector</i>.
- *
+ *
* @param iv
* the buffer used as initialization vector.
* @throws NullPointerException
@@ -53,7 +53,7 @@
* Creates a new <code>IvParameterSpec</code> instance with <code>len</code>
* bytes from the specified buffer <code>iv</code> starting at
* <code>offset</code>.
- *
+ *
* @param iv
* the buffer used as initialization vector.
* @param offset
@@ -81,7 +81,7 @@
/**
* Returns a copy of the <i>initialization vector</i> 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 ebb6cce..29b572d 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 @@
* <p>
* This padding algorithm is defined in the <a
* href="http://www.ietf.org/rfc/rfc3447.txt">PKCS #1</a> standard.
- *
- * @since Android 1.0
*/
public class OAEPParameterSpec implements AlgorithmParameterSpec {
@@ -60,7 +58,7 @@
* <i>message digest</i> algorithm name, <i>mask generation function</i>
* (<i>mgf</i>) algorithm name, <i>parameters</i> for the <i>mgf</i>
* algorithm and the <i>source of the label <code>L</code></i>.
- *
+ *
* @param mdName
* the message digest algorithm name.
* @param mgfName
@@ -87,7 +85,7 @@
/**
* Returns the algorithm name of the <i>message digest</i>.
- *
+ *
* @return the algorithm name of the message digest.
*/
public String getDigestAlgorithm() {
@@ -96,7 +94,7 @@
/**
* Returns the algorithm name of the <i>mask generation function</i>.
- *
+ *
* @return the algorithm name of the mask generation function.
*/
public String getMGFAlgorithm() {
@@ -106,7 +104,7 @@
/**
* 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 @@
/**
* Returns the source of the label <code>L</code>.
- *
+ *
* @return the source of the label <code>L</code>.
*/
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 c46617e..d79fd3c 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 @@
* <p>
* Password based encryption is described in <a
* href="http://www.ietf.org/rfc/rfc2898.txt">PKCS #5</a>.
- *
- * @since Android 1.0
*/
public class PBEKeySpec implements KeySpec {
@@ -39,7 +37,7 @@
/**
* Creates a new <code>PBEKeySpec</code> with the specified password.
- *
+ *
* @param password
* the password.
*/
@@ -58,7 +56,7 @@
/**
* Creates a new <code>PBEKeySpec</code> with the specified password, salt,
* iteration count and the desired length of the derived key.
- *
+ *
* @param password
* the password.
* @param salt
@@ -104,7 +102,7 @@
/**
* Creates a new <code>PBEKeySpec</code> with the specified password, salt
* and iteration count.
- *
+ *
* @param password
* the password.
* @param salt
@@ -150,7 +148,7 @@
/**
* 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 @@
/**
* 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 @@
/**
* Returns the iteration count of this key specification.
- *
+ *
* @return the iteration count of this key specification.
*/
public final int getIterationCount() {
@@ -190,7 +188,7 @@
/**
* 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 190986e..cce3832 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 @@
/**
* The algorithm parameter specification for a <i>password based encryption</i>
- * algorithm.
+ * algorithm.
* <p>
* Password based encryption is described in <a
* href="http://www.ietf.org/rfc/rfc2898.txt">PKCS #5</a>.
- *
- * @since Android 1.0
*
*/
public class PBEParameterSpec implements AlgorithmParameterSpec {
@@ -39,7 +37,7 @@
/**
* Creates a new <code>PBEParameterSpec</code> with the specified salt and
* iteration count.
- *
+ *
* @param salt
* the salt.
* @param iterationCount
@@ -58,7 +56,7 @@
/**
* Returns a copy to the salt.
- *
+ *
* @return a copy to the salt.
*/
public byte[] getSalt() {
@@ -69,7 +67,7 @@
/**
* 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 d5bdf1b..30fd8af 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 @@
/**
* The source of the label <code>L</code> as specified in <a
* href="http://www.ietf.org/rfc/rfc3447.txt"> PKCS #1</a>.
- *
- * @since Android 1.0
*/
public class PSource {
@@ -34,7 +32,7 @@
/**
* Creates a new <code>PSource</code> instance with the specified source
* algorithm identifier.
- *
+ *
* @param pSrcName
* the source algorithm identifier.
* @throws NullPointerException
@@ -49,7 +47,7 @@
/**
* Returns the source algorithm identifier.
- *
+ *
* @return the source algorithm identifier.
*/
public String getAlgorithm() {
@@ -59,15 +57,14 @@
/**
* The explicit specification of the parameter <code>P</code> used in the
* source algorithm.
- *
- * @since Android 1.0
*/
public static final class PSpecified extends PSource {
private final byte[] p;
/**
- * The instance of <code>PSpecified</code> with the default value <code>byte[0]</code> for <code>P</code>
+ * The instance of <code>PSpecified</code> with the default value
+ * <code>byte[0]</code> for <code>P</code>
*/
public static final PSpecified DEFAULT = new PSpecified();
@@ -79,7 +76,7 @@
/**
* Creates a new instance of <code>PSpecified</code> with the specified
* parameter <code>P</code>.
- *
+ *
* @param p
* the parameter <code>P</code>.
* @throws NullPointerException
@@ -98,7 +95,7 @@
/**
* Returns a copy of the value of the parameter <code>P</code>.
- *
+ *
* @return a copy of the value of the parameter <code>P</code>
*/
public byte[] getValue() {
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 bd76cf4..bc7a39c 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 @@
/**
* The algorithm parameter specification for the <a
* href="http://www.ietf.org/rfc/rfc2268.txt">RC2</a> algorithm.
- *
- * @since Android 1.0
*/
public class RC2ParameterSpec implements AlgorithmParameterSpec {
@@ -36,7 +34,7 @@
/**
* Creates a new <code>RC2ParameterSpec</code> instance with the specified
* effective key length (in bits),
- *
+ *
* @param effectiveKeyBits
* the effective key length (in bits).
*/
@@ -51,7 +49,7 @@
* <p>
* The size of the <i>initialization vector</i> must be at least 8 bytes
* which are copied to protect them against modification.
- *
+ *
* @param effectiveKeyBits
* the effective key length (in bits).
* @param iv
@@ -78,7 +76,7 @@
* The size of the <i>initialization vector</i> starting at
* <code>offset</code> must be at least 8 bytes which are copied to protect
* them against modification.
- *
+ *
* @param effectiveKeyBits
* the effective key length (in bits).
* @param iv
@@ -103,7 +101,7 @@
/**
* Returns the effective key length (in bits).
- *
+ *
* @return the effective key length (in bits).
*/
public int getEffectiveKeyBits() {
@@ -112,7 +110,7 @@
/**
* 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 @@
/**
* Compares the specified object to this <code>RC2ParameterSpec</code>
* instance.
- *
+ *
* @param obj
* the object to compare.
* @return true if the effective key length and the initialization vector of
@@ -148,7 +146,7 @@
/**
* Returns the hash code of this <code>RC2ParameterSpec</code> 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 f711f41..57010f7 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 @@
/**
* The algorithm parameter specification for the <a
* href="http://www.ietf.org/rfc/rfc2040.txt">RC5</a> algorithm.
- *
- * @since Android 1.0
*/
public class RC5ParameterSpec implements AlgorithmParameterSpec {
@@ -38,7 +36,7 @@
/**
* Creates a new <code>RC5ParameterSpec</code> instance with the specified
* version, round count an word size (in bits).
- *
+ *
* @param version
* the version.
* @param rounds
@@ -61,7 +59,7 @@
* The size of the <i>initialization vector</i> must be at least
* <code>2 * (wordSize / 8)</code> bytes which are copied to protect them
* against modification.
- *
+ *
* @param version
* the version.
* @param rounds
@@ -97,7 +95,7 @@
* The size of the <i>initialization vector</i> must be at least
* <code>offset + (2 * (wordSize / 8))</code> bytes. The bytes starting at
* <code>offset</code> are copied to protect them against modification.
- *
+ *
* @param version
* the version.
* @param rounds
@@ -135,7 +133,7 @@
/**
* Returns the version.
- *
+ *
* @return the version.
*/
public int getVersion() {
@@ -144,7 +142,7 @@
/**
* Returns the round count.
- *
+ *
* @return the round count.
*/
public int getRounds() {
@@ -153,7 +151,7 @@
/**
* Returns the word size (in bits).
- *
+ *
* @return the word size (in bits).
*/
public int getWordSize() {
@@ -162,7 +160,7 @@
/**
* 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 @@
/**
* Compares the specified object with this <code>RC5ParameterSpec</code>
* instance.
- *
+ *
* @param obj
* the object to compare.
* @return true if version, round count, word size and initializaion vector
@@ -200,7 +198,7 @@
/**
* Returns the hash code of this <code>RC5ParameterSpec</code> 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 897948c..d1eba47 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 @@
* A key specification for a <code>SecretKey</code> and also a secret key
* implementation that is provider-independent. It can be used for raw secret
* keys that can be specified as <code>byte[]</code>.
- *
- * @since Android 1.0
*/
public class SecretKeySpec implements SecretKey, KeySpec, Serializable {
@@ -50,7 +48,7 @@
/**
* Creates a new <code>SecretKeySpec</code> for the specified key data and
* algorithm name.
- *
+ *
* @param key
* the key data.
* @param algorithm
@@ -79,7 +77,7 @@
* Creates a new <code>SecretKeySpec</code> for the key data from the
* specified buffer <code>key</code> starting at <code>offset</code> with
* length <code>len</code> and the specified <code>algorithm</code> name.
- *
+ *
* @param key
* the key data.
* @param offset
@@ -120,7 +118,7 @@
/**
* Returns the algorithm name.
- *
+ *
* @return the algorithm name.
*/
public String getAlgorithm() {
@@ -129,7 +127,7 @@
/**
* Returns the name of the format used to encode the key.
- *
+ *
* @return the format name "RAW".
*/
public String getFormat() {
@@ -138,7 +136,7 @@
/**
* Returns the encoded form of this secret key.
- *
+ *
* @return the encoded form of this secret key.
*/
public byte[] getEncoded() {
@@ -149,7 +147,7 @@
/**
* Returns the hash code of this <code>SecretKeySpec</code> object.
- *
+ *
* @return the hash code.
*/
@Override
@@ -164,7 +162,7 @@
/**
* Compares the specified object with this <code>SecretKeySpec</code>
* instance.
- *
+ *
* @param obj
* the object to compare.
* @return true if the algorithm name and key of both object are equal,
diff --git a/libcore/luni/src/main/java/org/apache/harmony/luni/internal/net/www/protocol/http/HttpURLConnection.java b/libcore/luni/src/main/java/org/apache/harmony/luni/internal/net/www/protocol/http/HttpURLConnection.java
index 104a981..2dea92b 100644
--- a/libcore/luni/src/main/java/org/apache/harmony/luni/internal/net/www/protocol/http/HttpURLConnection.java
+++ b/libcore/luni/src/main/java/org/apache/harmony/luni/internal/net/www/protocol/http/HttpURLConnection.java
@@ -1385,7 +1385,9 @@
output.append("\r\n"); //$NON-NLS-1$
}
if (reqHeader.get("Accept") == null) { //$NON-NLS-1$
- output.append("Accept: *; */*\r\n"); //$NON-NLS-1$
+ // BEGIN android-changed
+ output.append("Accept: *, */*\r\n"); //$NON-NLS-1$
+ // END android-changed
}
if (httpVersion > 0 && reqHeader.get("Connection") == null) { //$NON-NLS-1$
output.append("Connection: Keep-Alive\r\n"); //$NON-NLS-1$
diff --git a/libcore/luni/src/test/java/org/apache/harmony/luni/tests/java/net/URLConnectionTest.java b/libcore/luni/src/test/java/org/apache/harmony/luni/tests/java/net/URLConnectionTest.java
index bcd73d8..68ccb91 100644
--- a/libcore/luni/src/test/java/org/apache/harmony/luni/tests/java/net/URLConnectionTest.java
+++ b/libcore/luni/src/test/java/org/apache/harmony/luni/tests/java/net/URLConnectionTest.java
@@ -17,14 +17,11 @@
package org.apache.harmony.luni.tests.java.net;
import dalvik.annotation.BrokenTest;
-import dalvik.annotation.KnownFailure;
import dalvik.annotation.TestLevel;
import dalvik.annotation.TestTargetClass;
import dalvik.annotation.TestTargetNew;
import dalvik.annotation.TestTargets;
-
import junit.framework.TestCase;
-
import tests.support.Support_Configuration;
import tests.support.Support_PortManager;
import tests.support.Support_TestWebData;
@@ -59,7 +56,6 @@
import java.net.URLStreamHandler;
import java.net.UnknownServiceException;
import java.security.Permission;
-import java.text.DateFormat;
import java.text.ParseException;
import java.util.Arrays;
import java.util.Calendar;
@@ -463,6 +459,28 @@
}
}
+ public void testHttpPostHeaders() throws IOException {
+ String path = "/" + Math.random();
+ HttpURLConnection connection = (HttpURLConnection)
+ new URL("http://localhost:" + port + path).openConnection();
+
+ // post a request
+ connection.setDoOutput(true);
+ OutputStreamWriter writer
+ = new OutputStreamWriter(connection.getOutputStream());
+ writer.write("hello");
+ writer.flush();
+ assertEquals(200, connection.getResponseCode());
+
+ // validate the request by asking the server what was received
+ Map<String, String> headers = server.pathToRequest().get(path).getHeaders();
+ assertEquals("*, */*", headers.get("Accept"));
+ assertEquals("application/x-www-form-urlencoded", headers.get("Content-Type"));
+ assertEquals("5", headers.get("Content-Length"));
+ assertEquals("localhost:" + port, headers.get("Host"));
+ // TODO: test User-Agent?
+ }
+
/**
* @throws IOException
* @tests {@link java.net.URLConnection#getAllowUserInteraction()}
diff --git a/libcore/support/src/test/java/tests/support/Support_TestWebServer.java b/libcore/support/src/test/java/tests/support/Support_TestWebServer.java
index 8ee7248..609e993 100644
--- a/libcore/support/src/test/java/tests/support/Support_TestWebServer.java
+++ b/libcore/support/src/test/java/tests/support/Support_TestWebServer.java
@@ -19,9 +19,9 @@
import java.io.*;
import java.lang.Thread;
import java.net.*;
-import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.*;
+import java.util.concurrent.ConcurrentHashMap;
import java.util.logging.Logger;
/**
@@ -42,6 +42,10 @@
/* Where worker threads stand idle */
Vector threads = new Vector();
+ /** maps the recently requested URLs to the full request snapshot */
+ private final Map<String, Request> pathToRequest
+ = new ConcurrentHashMap<String, Request>();
+
/* List of all active worker threads */
Vector activeThreads = new Vector();
@@ -206,7 +210,7 @@
* a redirect code with the Location response header set to the value
* specified.
* @param redirect The location to be redirected to
- * @param redirectCode The code to send when redirecting
+ * @param code The code to send when redirecting
*/
public void setRedirect(String redirect, int code) {
redirectHost = redirect;
@@ -215,6 +219,14 @@
}
/**
+ * Returns a map from recently-requested paths (like "/index.html") to a
+ * snapshot of the request data.
+ */
+ public Map<String, Request> pathToRequest() {
+ return pathToRequest;
+ }
+
+ /**
* Cause the thread accepting connections on the server socket to close
*/
public void close() {
@@ -328,6 +340,28 @@
static final byte[] EOL = {(byte)'\r', (byte)'\n' };
/**
+ * An immutable snapshot of an HTTP request.
+ */
+ public static class Request {
+ private final String path;
+ private final Map<String, String> headers;
+ // TODO: include posted content?
+
+ public Request(String path, Map<String, String> headers) {
+ this.path = path;
+ this.headers = new LinkedHashMap<String, String>(headers);
+ }
+
+ public String getPath() {
+ return path;
+ }
+
+ public Map<String, String> getHeaders() {
+ return headers;
+ }
+ }
+
+ /**
* The worker thread handles all interactions with a current open
* connection. If pipelining is turned on, this will allow this
* thread to continuously operate on numerous requests before the
@@ -347,6 +381,9 @@
/* Reference to current requests test file/data */
private String testID;
+ /* The requested path, such as "/test1" */
+ private String path;
+
/* Reference to test number from testID */
private int testNum;
@@ -359,7 +396,7 @@
boolean running = false;
/* Request headers are stored here */
- private Hashtable<String, String> headers = new Hashtable<String, String>();
+ private Map<String, String> headers = new LinkedHashMap<String, String>();
/* Create a new worker thread */
Worker() {
@@ -559,10 +596,8 @@
i++;
}
- testID = new String(buf, 0, index, i-index);
- if (testID.startsWith("/")) {
- testID = testID.substring(1);
- }
+ path = new String(buf, 0, index, i-index);
+ testID = path.substring(1);
return nread;
}
@@ -601,7 +636,7 @@
while (buf[i] == ' ') {
i++;
}
- String headerValue = new String(buf, i, nread-1);
+ String headerValue = new String(buf, i, nread-i);
headers.put(headerName, headerValue);
return nread;
@@ -666,6 +701,8 @@
// If status line found, read any headers
nread = readHeaders(is);
+ pathToRequest().put(path, new Request(path, headers));
+
// Then read content (if any)
// TODO handle chunked encoding from the client
if (headers.get(requestHeaders[REQ_CONTENT_LENGTH]) != null) {