18#ifndef _DECAF_SECURITY_MESSAGEDIGEST_H_
19#define _DECAF_SECURITY_MESSAGEDIGEST_H_
32 class MessageDigestImpl;
74 MessageDigestImpl* impl;
78 std::string algorithm;
82 MessageDigest(
const MessageDigest&);
83 MessageDigest& operator= (
const MessageDigest&);
116 int digest(
unsigned char* input,
int size,
int offset,
int length);
130 std::vector<unsigned char>
digest(
const unsigned char* input,
int size);
142 std::vector<unsigned char>
digest(
const std::vector<unsigned char>& input);
151 return this->algorithm;
163 return this->provider;
217 void update(
unsigned char* input,
int size,
int offset,
int length);
225 void update(
const std::vector<unsigned char>& input);
268 static bool isEqual(
const std::vector<unsigned char>& digesta,
269 const std::vector<unsigned char>& digestb);
This class defines six categories of operations upon byte buffers:
Definition ByteBuffer.h:98
void update(unsigned char *input, int size, int offset, int length)
Updates the digest using the specified array of bytes, starting at the specified offset.
std::vector< unsigned char > digest(const unsigned char *input, int size)
Performs a final update on the digest using the specified array of bytes, then completes the digest c...
void update(unsigned char input)
Updates the digest using the specified byte.
int digest(unsigned char *input, int size, int offset, int length)
Completes the hash computation by performing final operations such as padding.
MessageDigest(const std::string &name)
static MessageDigest * getInstance(const std::string &algorithm)
Returns a MessageDigest object that implements the specified digest algorithm.
static bool isEqual(const std::vector< unsigned char > &digesta, const std::vector< unsigned char > &digestb)
Compares two digests for equality.
void update(nio::ByteBuffer &input)
Update the digest using the specified ByteBuffer.
std::string toString() const
Returns a string representation of this message digest object.
MessageDigest * clone()
Returns a clone of this MessageDisgest instance if the MessageDigestSpi in use is cloneable.
std::vector< unsigned char > digest()
Completes the hash computation by performing final operations such as padding.
void update(const std::vector< unsigned char > &input)
Updates the digest using the specified array of bytes.
const Provider * getProvider() const
Returns the Provider associated with this MessageDigest.
Definition MessageDigest.h:162
std::string getAlgorithmName() const
Returns a string that identifies the algorithm, independent of implementation details.
Definition MessageDigest.h:150
void reset()
Resets the digest for further use.
std::vector< unsigned char > digest(const std::vector< unsigned char > &input)
Performs a final update on the digest using the specified array of bytes, then completes the digest c...
int getDigestLength() const
Returns the length of the digest in bytes, or 0 if this operation is not supported by the provider an...
This class defines the Service Provider Interface (SPI) for the MessageDigest class,...
Definition MessageDigestSpi.h:47
This class represents a "provider" for the Decaf Security API, where a provider implements some or al...
Definition Provider.h:46
#define DECAF_API
Definition Config.h:29
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements.
Definition AprPool.h:25