Kea  1.9.9-git
isc::dns::NSEC3HashCreator Class Referenceabstract

Factory class of NSEC3Hash. More...

#include <nsec3hash.h>

+ Inheritance diagram for isc::dns::NSEC3HashCreator:

Public Member Functions

virtual ~NSEC3HashCreator ()
 The destructor. More...
 
virtual NSEC3Hashcreate (const rdata::generic::NSEC3PARAM &nsec3param) const =0
 Factory method of NSECHash from NSEC3PARAM RDATA. More...
 
virtual NSEC3Hashcreate (const rdata::generic::NSEC3 &nsec3) const =0
 Factory method of NSECHash from NSEC3 RDATA. More...
 
virtual NSEC3Hashcreate (uint8_t algorithm, uint16_t iterations, const uint8_t *salt_data, size_t salt_length) const =0
 Factory method of NSECHash from args. More...
 

Protected Member Functions

 NSEC3HashCreator ()
 The default constructor. More...
 

Detailed Description

Factory class of NSEC3Hash.

This class is an abstract base class that provides the creation interfaces of NSEC3Hash objects. By defining a specific derived class of the creator, normally with a different specific class of NSEC3Hash, the application can use a customized implementation of NSEC3Hash without changing the library itself. The intended primary application of such customization is tests (it would be convenient for a test to produce a faked hash value regardless of the input so it doesn't have to identify a specific input value to produce a particular hash). Another possibility would be an experimental extension for a newer hash algorithm or implementation.

The three main methods named create() correspond to the static factory methods of NSEC3Hash of the same name.

By default, the library uses the DefaultNSEC3HashCreator creator. The setNSEC3HashCreator() function can be used to replace it with a user defined version. For such customization purposes as implementing experimental new hash algorithms, the application may internally want to use the DefaultNSEC3HashCreator in general cases while creating a customized type of NSEC3Hash object for that particular hash algorithm.

The creator objects are generally expected to be stateless; they will only encapsulate the factory logic. The create() methods are declared as const member functions for this reason. But if we see the need for having a customized creator that benefits from its own state in future, this condition can be loosened.

Definition at line 203 of file nsec3hash.h.

Constructor & Destructor Documentation

isc::dns::NSEC3HashCreator::NSEC3HashCreator ( )
inlineprotected

The default constructor.

Make very sure this isn't directly instantiated by making it protected even if this class is modified to lose all pure virtual methods.

Definition at line 209 of file nsec3hash.h.

virtual isc::dns::NSEC3HashCreator::~NSEC3HashCreator ( )
inlinevirtual

The destructor.

This does nothing; defined only for allowing derived classes to specialize its behavior.

Definition at line 216 of file nsec3hash.h.

Member Function Documentation

virtual NSEC3Hash* isc::dns::NSEC3HashCreator::create ( const rdata::generic::NSEC3PARAM nsec3param) const
pure virtual

Factory method of NSECHash from NSEC3PARAM RDATA.

See NSEC3Hash::create(const rdata::generic::NSEC3PARAM& param)

Implemented in isc::dns::DefaultNSEC3HashCreator.

virtual NSEC3Hash* isc::dns::NSEC3HashCreator::create ( const rdata::generic::NSEC3 nsec3) const
pure virtual

Factory method of NSECHash from NSEC3 RDATA.

See NSEC3Hash::create(const rdata::generic::NSEC3& param)

Implemented in isc::dns::DefaultNSEC3HashCreator.

virtual NSEC3Hash* isc::dns::NSEC3HashCreator::create ( uint8_t  algorithm,
uint16_t  iterations,
const uint8_t *  salt_data,
size_t  salt_length 
) const
pure virtual

Factory method of NSECHash from args.

See NSEC3Hash::create(uint8_t algorithm, uint16_t iterations, const uint8_t* salt_data, size_t salt_length)

Parameters
algorithmthe NSEC3 algorithm to use; currently only 1 (SHA-1) is supported
iterationsthe number of iterations
salt_datathe salt data as a byte array
salt_lengththe length of the salt data

Implemented in isc::dns::DefaultNSEC3HashCreator.


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