If you want to write your own security provider, you have the option of creating your own message digest engine. Typically, you’d do this because you want to ensure that a particular algorithm like SHA is available regardless of who the default security provider is; if you have a mathematics background, it’s conceivable that you might want to implement your own algorithm.
In order to implement a message digest algorithm, you must provide a
concrete subclass of the
class. That means providing a body for
each of the following methods:
given bytes to the data over which the
digest will be calculated. Note that there is no method in this list
that accepts simply an array of bytes; the
update(byte b) method in the base class simply uses an offset of
and a length equal to the entire array.
digest over the accumulated data,
resetting the internal state of the object afterwards. Note that
there is no corresponding method that accepts an array of bytes as an
digest( ) method in the base class
simply calls the
engineUpdate( ) method if
needed before calling the
Calculate the digest, placing the output into the
buf array (starting at the given
offset and proceeding ...