java.lang.Object | ||
↳ | java.security.MessageDigestSpi | |
↳ | java.security.MessageDigest |
MessageDigest
is an engine class which is capable of generating one
way hash values for arbitrary input, utilizing the algorithm it was
initialized with.
Protected Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Constructs a new instance of
MessageDigest with the name of
the algorithm to use. |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Creates and returns a copy of this
Object . | |||||||||||
Computes and returns the final hash value for this MessageDigest.
| |||||||||||
Performs the final update and then computes and returns the final hash
value for this MessageDigest.
| |||||||||||
Computes and stores the final hash value for this MessageDigest.
| |||||||||||
Returns the name of the algorithm of this
MessageDigest . | |||||||||||
Returns the engine digest length in bytes.
| |||||||||||
Returns a new instance of
MessageDigest that utilizes the
specified algorithm from the specified provider. | |||||||||||
Returns a new instance of
MessageDigest that utilizes the
specified algorithm. | |||||||||||
Returns a new instance of
MessageDigest that utilizes the
specified algorithm from the specified provider. | |||||||||||
Returns the provider associated with this
MessageDigest . | |||||||||||
Indicates whether to digest are equal by performing a simply
byte-per-byte compare of the two digests.
| |||||||||||
Puts this
MessageDigest back in an initial state, such that it is
ready to compute a one way hash value. | |||||||||||
Returns a string containing a concise, human-readable description of this
MessageDigest including the name of its algorithm. | |||||||||||
Updates this
MessageDigest using the given byte[] . | |||||||||||
Updates this
MessageDigest using the given byte . | |||||||||||
Updates this
MessageDigest using the given byte[] . | |||||||||||
Updates this
MessageDigest using the given input . |
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class java.security.MessageDigestSpi
| |||||||||||
From class java.lang.Object
|
Constructs a new instance of MessageDigest
with the name of
the algorithm to use.
algorithm | the name of algorithm to use |
---|
Creates and returns a copy of this Object
. The default
implementation returns a so-called "shallow" copy: It creates a new
instance of the same class and then copies the field values (including
object references) from this instance to the new instance. A "deep" copy,
in contrast, would also recursively clone nested objects. A subclass that
needs to implement this kind of cloning should call super.clone()
to create the new instance and then create deep copies of the nested,
mutable objects.
CloneNotSupportedException |
---|
Computes and returns the final hash value for this MessageDigest. After the digest is computed the receiver is reset.
Performs the final update and then computes and returns the final hash value for this MessageDigest. After the digest is computed the receiver is reset.
input | the byte array |
---|
Computes and stores the final hash value for this MessageDigest. After the digest is computed the receiver is reset.
buf | the buffer to store the result |
---|---|
offset | the index of the first byte in buf to store |
len | the number of bytes allocated for the digest |
buf
DigestException | if an error occures |
---|---|
IllegalArgumentException | if offset or len are not valid in respect to
buf |
Returns the name of the algorithm of this MessageDigest
.
MessageDigest
Returns the engine digest length in bytes. If the implementation does not
implement this function or is not an instance of Cloneable
,
0
is returned.
0
Returns a new instance of MessageDigest
that utilizes the
specified algorithm from the specified provider.
algorithm | the name of the algorithm to use |
---|---|
provider | the name of the provider |
MessageDigest
that utilizes the
specified algorithm from the specified providerNoSuchAlgorithmException | if the specified algorithm is not available |
---|---|
NoSuchProviderException | if the specified provider is not available |
NullPointerException | if algorithm is null |
Returns a new instance of MessageDigest
that utilizes the
specified algorithm.
algorithm | the name of the algorithm to use |
---|
MessageDigest
that utilizes the
specified algorithmNoSuchAlgorithmException | if the specified algorithm is not available |
---|---|
NullPointerException | if algorithm is null |
Returns a new instance of MessageDigest
that utilizes the
specified algorithm from the specified provider.
algorithm | the name of the algorithm to use |
---|---|
provider | the provider |
MessageDigest
that utilizes the
specified algorithm from the specified providerNoSuchAlgorithmException | if the specified algorithm is not available |
---|---|
NullPointerException | if algorithm is null |
Returns the provider associated with this MessageDigest
.
MessageDigest
Indicates whether to digest are equal by performing a simply byte-per-byte compare of the two digests.
digesta | the first digest to be compared |
---|---|
digestb | the second digest to be compared |
true
if the two hashes are equal, false
otherwisePuts this MessageDigest
back in an initial state, such that it is
ready to compute a one way hash value.
Returns a string containing a concise, human-readable description of this
MessageDigest
including the name of its algorithm.
MessageDigest
Updates this MessageDigest
using the given byte[]
.
input | the byte array |
---|
NullPointerException | if input is null |
---|
Updates this MessageDigest
using the given byte
.
arg0 | the byte to update this MessageDigest with |
---|
Updates this MessageDigest
using the given byte[]
.
input | the byte array |
---|---|
offset | the index of the first byte in input to update from |
len | the number of bytes in input to update from |
IllegalArgumentException | if offset or len are not valid in respect to
input |
---|
Updates this MessageDigest
using the given input
.
input | the ByteBuffer |
---|