# Poco

# template < class Engine >

# class HMACEngine

Library: Foundation
Package: Crypt
Header: Poco/HMACEngine.h

## Description

This class implements the HMAC message authentication code algorithm, as specified in RFC 2104. The underlying DigestEngine (MD5Engine, SHA1Engine, etc.) must be given as template argument. Since the HMACEngine is a DigestEngine, it can be used with the DigestStream class to create a HMAC for a stream.

## Inheritance

Direct Base Classes: DigestEngine

All Base Classes: DigestEngine

## Member Summary

Member Functions: digest, digestLength, init, operator =, reset, updateImpl

Inherited Functions: constantTimeEquals, digest, digestFromHex, digestLength, digestToHex, reset, update, updateImpl

## Enumerations

### Anonymous

BLOCK_SIZE = Engine::BLOCK_SIZE

DIGEST_SIZE = Engine::DIGEST_SIZE

## Constructors

### HMACEngine

HMACEngine() = delete;

### HMACEngine

HMACEngine(
const std::string & passphrase
);

### HMACEngine

HMACEngine(
const HMACEngine & param270
) = delete;

### HMACEngine

HMACEngine(
const char * passphrase,
std::size_t length
);

## Destructor

### ~HMACEngine

~HMACEngine() override;

## Member Functions

### digest

const DigestEngine::Digest & digest() override;

### digestLength

std::size_t digestLength() const override;

See also: Poco::DigestEngine::digestLength()

### operator =

HMACEngine & operator = (
const HMACEngine & param271
) = delete;

### reset

void reset() override;

See also: Poco::DigestEngine::reset()

### init

void init(
const char * passphrase,
std::size_t length
);

### updateImpl

void updateImpl(
const void * data,
std::size_t length
) override;

See also: Poco::DigestEngine::updateImpl()