mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 06:45:07 +02:00
8284851: Update javax.crypto files to use proper javadoc for mentioned classes
Reviewed-by: weijun, valeriep
This commit is contained in:
parent
8cdead0c94
commit
f804f2ce8e
92 changed files with 2142 additions and 2010 deletions
|
@ -37,12 +37,12 @@ import sun.security.util.MessageDigestSpi2;
|
|||
import javax.crypto.SecretKey;
|
||||
|
||||
/**
|
||||
* This MessageDigest class provides applications the functionality of a
|
||||
* This {@code MessageDigest} class provides applications the functionality of a
|
||||
* message digest algorithm, such as SHA-1 or SHA-256.
|
||||
* Message digests are secure one-way hash functions that take arbitrary-sized
|
||||
* data and output a fixed-length hash value.
|
||||
*
|
||||
* <p>A MessageDigest object starts out initialized. The data is
|
||||
* <p>A {@code MessageDigest} object starts out initialized. The data is
|
||||
* processed through it using the {@link #update(byte) update}
|
||||
* methods. At any point {@link #reset() reset} can be called
|
||||
* to reset the digest. Once all the data to be updated has been
|
||||
|
@ -50,12 +50,12 @@ import javax.crypto.SecretKey;
|
|||
* be called to complete the hash computation.
|
||||
*
|
||||
* <p>The {@code digest} method can be called once for a given number
|
||||
* of updates. After {@code digest} has been called, the MessageDigest
|
||||
* of updates. After {@code digest} has been called, the {@code MessageDigest}
|
||||
* object is reset to its initialized state.
|
||||
*
|
||||
* <p>Implementations are free to implement the Cloneable interface.
|
||||
* Client applications can test cloneability by attempting cloning
|
||||
* and catching the CloneNotSupportedException:
|
||||
* and catching the {@code CloneNotSupportedException}:
|
||||
*
|
||||
* <pre>{@code
|
||||
* MessageDigest md = MessageDigest.getInstance("SHA-256");
|
||||
|
@ -139,14 +139,14 @@ public abstract class MessageDigest extends MessageDigestSpi {
|
|||
}
|
||||
|
||||
/**
|
||||
* Returns a MessageDigest object that implements the specified digest
|
||||
* algorithm.
|
||||
* Returns a {@code MessageDigest} object that implements the specified
|
||||
* digest algorithm.
|
||||
*
|
||||
* <p> This method traverses the list of registered security Providers,
|
||||
* starting with the most preferred Provider.
|
||||
* A new MessageDigest object encapsulating the
|
||||
* MessageDigestSpi implementation from the first
|
||||
* Provider that supports the specified algorithm is returned.
|
||||
* A new {@code MessageDigest} object encapsulating the
|
||||
* {@code MessageDigestSpi} implementation from the first
|
||||
* provider that supports the specified algorithm is returned.
|
||||
*
|
||||
* <p> Note that the list of registered providers may be retrieved via
|
||||
* the {@link Security#getProviders() Security.getProviders()} method.
|
||||
|
@ -201,11 +201,11 @@ public abstract class MessageDigest extends MessageDigestSpi {
|
|||
}
|
||||
|
||||
/**
|
||||
* Returns a MessageDigest object that implements the specified digest
|
||||
* algorithm.
|
||||
* Returns a {@code MessageDigest} object that implements the specified
|
||||
* digest algorithm.
|
||||
*
|
||||
* <p> A new MessageDigest object encapsulating the
|
||||
* MessageDigestSpi implementation from the specified provider
|
||||
* <p> A new {@code MessageDigest} object encapsulating the
|
||||
* {@code MessageDigestSpi} implementation from the specified provider
|
||||
* is returned. The specified provider must be registered
|
||||
* in the security provider list.
|
||||
*
|
||||
|
@ -258,13 +258,13 @@ public abstract class MessageDigest extends MessageDigestSpi {
|
|||
}
|
||||
|
||||
/**
|
||||
* Returns a MessageDigest object that implements the specified digest
|
||||
* algorithm.
|
||||
* Returns a {@code MessageDigest} object that implements the specified
|
||||
* digest algorithm.
|
||||
*
|
||||
* <p> A new MessageDigest object encapsulating the
|
||||
* MessageDigestSpi implementation from the specified Provider
|
||||
* object is returned. Note that the specified Provider object
|
||||
* does not have to be registered in the provider list.
|
||||
* <p> A new {@code MessageDigest} object encapsulating the
|
||||
* {@code MessageDigestSpi} implementation from the specified provider
|
||||
* is returned. Note that the specified provider does not
|
||||
* have to be registered in the provider list.
|
||||
*
|
||||
* @param algorithm the name of the algorithm requested.
|
||||
* See the MessageDigest section in the <a href=
|
||||
|
@ -466,7 +466,7 @@ public abstract class MessageDigest extends MessageDigestSpi {
|
|||
*
|
||||
* @param digestb the other digest to compare.
|
||||
*
|
||||
* @return true if the digests are equal, false otherwise.
|
||||
* @return {@code true} if the digests are equal, {@code false} otherwise.
|
||||
*/
|
||||
public static boolean isEqual(byte[] digesta, byte[] digestb) {
|
||||
if (digesta == digestb) return true;
|
||||
|
@ -557,17 +557,18 @@ public abstract class MessageDigest extends MessageDigestSpi {
|
|||
|
||||
|
||||
/*
|
||||
* The following class allows providers to extend from MessageDigestSpi
|
||||
* rather than from MessageDigest. It represents a MessageDigest with an
|
||||
* The following class allows providers to extend from
|
||||
* {@code MessageDigestSpi} rather than from {@code MessageDigest}.
|
||||
* It represents a message digest with an
|
||||
* encapsulated, provider-supplied SPI object (of type MessageDigestSpi).
|
||||
* If the provider implementation is an instance of MessageDigestSpi,
|
||||
* the getInstance() methods above return an instance of this class, with
|
||||
* the SPI object encapsulated.
|
||||
* If the provider implementation is an instance of
|
||||
* {@code MessageDigestSpi}, the {@code getInstance()} methods
|
||||
* above return an instance of this class, with the SPI object encapsulated.
|
||||
*
|
||||
* Note: All SPI methods from the original MessageDigest class have been
|
||||
* moved up the hierarchy into a new class (MessageDigestSpi), which has
|
||||
* been interposed in the hierarchy between the API (MessageDigest)
|
||||
* and its original parent (Object).
|
||||
* Note: All SPI methods from the original {@code MessageDigest} class
|
||||
* have been moved up the hierarchy into a new class
|
||||
* ({@code MessageDigestSpi}), which has been interposed in the hierarchy
|
||||
* between the API ({@code MessageDigest}) and its original parent (Object).
|
||||
*/
|
||||
|
||||
private static class Delegate extends MessageDigest
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue