decaf::security::MessageDigestSpi Class Reference

This class defines the Service Provider Interface (SPI) for the MessageDigest class, which provides the functionality of a message digest algorithm, such as MD5 or SHA. More...

#include <src/main/decaf/security/MessageDigestSpi.h>

Inheritance diagram for decaf::security::MessageDigestSpi:
Inheritance graph
[legend]

Public Member Functions

 MessageDigestSpi ()
virtual ~MessageDigestSpi ()
virtual bool isCloneable () const
 Queries the SPI implementation and returns true if the SPI can be cloned.
virtual MessageDigestSpiclone ()
 Returns a clone if the implementation supports being cloned.

Protected Member Functions

virtual int engineGetDigestLength ()=0
 Returns the digest length in bytes.
virtual void engineUpdate (unsigned char input)=0
 Updates the digest using the specified byte.
virtual void engineUpdate (const unsigned char *input, int size, int offset, int length)=0
 Updates the digest using the specified array of bytes, starting at the specified offset.
virtual void engineReset ()=0
 Resets the digest for further use.
virtual void engineUpdate (const std::vector< unsigned char > &input)=0
 Update the digest using the specified Vector of Bytes.
virtual void engineUpdate (decaf::nio::ByteBuffer &input)=0
 Update the digest using the specified ByteBuffer.
virtual std::vector< unsigned
char > 
engineDigest ()=0
 Completes the hash computation by performing final operations such as padding.
virtual int engineDigest (unsigned char *buffer, int size, int offset, int length)=0
 Completes the hash computation by performing final operations such as padding.

Friends

class MessageDigest

Detailed Description

This class defines the Service Provider Interface (SPI) for the MessageDigest class, which provides the functionality of a message digest algorithm, such as MD5 or SHA.

Message digests are secure one-way hash functions that take arbitrary-sized data and output a fixed-length hash value.

All the pure virtual methods in this class must be implemented by a cryptographic service provider who wishes to supply the implementation of a particular message digest algorithm.

Implementations are free to implement clone method or throw a CloneNotSupportedException..

Since:
1.0

Constructor & Destructor Documentation

decaf::security::MessageDigestSpi::MessageDigestSpi (  ) 
virtual decaf::security::MessageDigestSpi::~MessageDigestSpi (  )  [virtual]

Member Function Documentation

virtual MessageDigestSpi* decaf::security::MessageDigestSpi::clone (  )  [virtual]

Returns a clone if the implementation supports being cloned.

Returns:
a new pointer that is a copy of this object.
Exceptions:
CloneNotSupportedException if this is called on an implementation that does not support cloning.

Reimplemented in decaf::internal::security::provider::crypto::MD4MessageDigestSpi, decaf::internal::security::provider::crypto::MD5MessageDigestSpi, and decaf::internal::security::provider::crypto::SHA1MessageDigestSpi.

virtual int decaf::security::MessageDigestSpi::engineDigest ( unsigned char *  buffer,
int  size,
int  offset,
int  length 
) [protected, pure virtual]

Completes the hash computation by performing final operations such as padding.

Once engineDigest has been called, the engine should be reset (see engineReset). Resetting is the responsibility of the engine implementor.

Parameters:
buffer The output buffer in which to store the digest
size The size of the given input buffer
offset The offset to start from in the output buffer
length The number of bytes within buffer allotted for the digest. Both this default implementation and the SUN provider do not return partial digests. The presence of this parameter is solely for consistency in our API's. If the value of this parameter is less than the actual digest length, the method will throw a DigestException. This parameter is ignored if its value is greater than or equal to the actual digest length.
Returns:
the length of the digest stored in the output buffer.
Exceptions:
DigestException if an error occurs.
NullPointerException if the buffer pointer is NULL.

Implemented in decaf::internal::security::provider::crypto::MD4MessageDigestSpi, decaf::internal::security::provider::crypto::MD5MessageDigestSpi, and decaf::internal::security::provider::crypto::SHA1MessageDigestSpi.

virtual std::vector<unsigned char> decaf::security::MessageDigestSpi::engineDigest (  )  [protected, pure virtual]

Completes the hash computation by performing final operations such as padding.

Once engineDigest has been called, the engine should be reset (see engineReset). Resetting is the responsibility of the engine implementor.

Returns:
an STL vector of bytes containing the resulting hash value.

Implemented in decaf::internal::security::provider::crypto::MD4MessageDigestSpi, decaf::internal::security::provider::crypto::MD5MessageDigestSpi, and decaf::internal::security::provider::crypto::SHA1MessageDigestSpi.

virtual int decaf::security::MessageDigestSpi::engineGetDigestLength (  )  [protected, pure virtual]
virtual void decaf::security::MessageDigestSpi::engineReset (  )  [protected, pure virtual]
virtual void decaf::security::MessageDigestSpi::engineUpdate ( decaf::nio::ByteBuffer input  )  [protected, pure virtual]

Update the digest using the specified ByteBuffer.

The digest is updated using the input.remaining() bytes starting at input.position(). Upon return, the buffer's position will be equal to its limit; its limit will not have changed.

Parameters:
input The ByteBuffer instance that will be used to update the digest.

Implemented in decaf::internal::security::provider::crypto::MD4MessageDigestSpi, decaf::internal::security::provider::crypto::MD5MessageDigestSpi, and decaf::internal::security::provider::crypto::SHA1MessageDigestSpi.

virtual void decaf::security::MessageDigestSpi::engineUpdate ( const std::vector< unsigned char > &  input  )  [protected, pure virtual]

Update the digest using the specified Vector of Bytes.

Parameters:
input The vector of bytes that will be used to update the digest.

Implemented in decaf::internal::security::provider::crypto::MD4MessageDigestSpi, decaf::internal::security::provider::crypto::MD5MessageDigestSpi, and decaf::internal::security::provider::crypto::SHA1MessageDigestSpi.

virtual void decaf::security::MessageDigestSpi::engineUpdate ( const unsigned char *  input,
int  size,
int  offset,
int  length 
) [protected, pure virtual]

Updates the digest using the specified array of bytes, starting at the specified offset.

Parameters:
input The array of bytes to use for the update.
size The size of the given input buffer..
offset The offset to start from in the array of bytes.
length The number of bytes to use, starting at offset.
Exceptions:
NullPointerException if the input array pointer is NULL.

Implemented in decaf::internal::security::provider::crypto::MD4MessageDigestSpi, decaf::internal::security::provider::crypto::MD5MessageDigestSpi, and decaf::internal::security::provider::crypto::SHA1MessageDigestSpi.

virtual void decaf::security::MessageDigestSpi::engineUpdate ( unsigned char  input  )  [protected, pure virtual]
virtual bool decaf::security::MessageDigestSpi::isCloneable (  )  const [virtual]

Queries the SPI implementation and returns true if the SPI can be cloned.

Returns:
true if the SPI is clonable.

Reimplemented in decaf::internal::security::provider::crypto::MD4MessageDigestSpi, decaf::internal::security::provider::crypto::MD5MessageDigestSpi, and decaf::internal::security::provider::crypto::SHA1MessageDigestSpi.


Friends And Related Function Documentation

friend class MessageDigest [friend]

The documentation for this class was generated from the following file:

Generated on 1 Dec 2014 for activemq-cpp-3.8.2 by  doxygen 1.6.1