tcMenu
Public Member Functions | List of all members
EepromAuthenticatorManager Class Reference

#include <RemoteAuthentication.h>

Inheritance diagram for EepromAuthenticatorManager:
AuthenticationManager

Public Member Functions

 EepromAuthenticatorManager (uint8_t numOfEntries=6)
 
void initialise (EepromAbstraction *eeprom, EepromPosition start, uint16_t magicKey=0x9B32)
 
void resetAllKeys ()
 
void changePin (const char *newPin)
 
void copyPinToBuffer (char *buffer, int size)
 
void copyKeyNameToBuffer (int idx, char *buffer, int bufSize)
 
bool addAdditionalUUIDKey (const char *connectionName, const char *uuid) override
 
bool isAuthenticated (const char *connectionName, const char *authResponse) override
 
bool doesPinMatch (const char *pinAttempt) override
 
int getNumberOfEntries () const
 
- Public Member Functions inherited from AuthenticationManager
 AuthenticationManager (AuthenticationManagerType authType)
 
AuthenticationManagerType getAuthenticationManagerType ()
 

Detailed Description

An implementation of AuthenticationManager that stores it's values in EEPROM. It stores up to KEY_STORAGE_SIZE (default 6) key value pairs in EEPROM and checks directly against them without any buffering.

Member Function Documentation

◆ initialise()

void EepromAuthenticatorManager::initialise ( EepromAbstraction *  eeprom,
EepromPosition  start,
uint16_t  magicKey = 0x9B32 
)

Initialises the authenticator with an eeprom object, start position in the rom and optional magic key. the magic key is used to determine if the rom contains anything reasonable on startup. The default will probably be OK

Parameters
eepromany eeprom abstraction from the IoAbstraction library
startposition in the rom to start writing at
magicKeythe value that is checked on load to see if stored data is trustworthy.

◆ resetAllKeys()

void EepromAuthenticatorManager::resetAllKeys ( )

Reset all keys in this authenticator, such that all connections would need to run through the normal joining behaviour.

◆ changePin()

void EepromAuthenticatorManager::changePin ( const char *  newPin)

Changes the current pin to a new pin

Parameters
newPinthe new pin to save

◆ copyPinToBuffer()

void EepromAuthenticatorManager::copyPinToBuffer ( char *  buffer,
int  size 
)

copies the current pin into the buffer provided.

Parameters
bufferthe area to copy to
sizethe buffer size

◆ copyKeyNameToBuffer()

void EepromAuthenticatorManager::copyKeyNameToBuffer ( int  idx,
char *  buffer,
int  bufSize 
)

Copy the name of the item at position idx into the provided buffer.

Parameters
idxthe index to get the name of
bufferthe buffer to copy into
bufSizesize of buffer usually obtained from sizeof

◆ addAdditionalUUIDKey()

bool EepromAuthenticatorManager::addAdditionalUUIDKey ( const char *  connectionName,
const char *  uuid 
)
overridevirtual

Attempt to add an additional UUID to key mapping, may fail if there is not enough space to add another mapping.

Parameters
connectionNamethe name of the connection
uuidthe key associated with it.

Implements AuthenticationManager.

◆ isAuthenticated()

bool EepromAuthenticatorManager::isAuthenticated ( const char *  connectionName,
const char *  authResponse 
)
overridevirtual

Check if the connectionName and authResponse match the one on record.

Parameters
connectionNamethe name of the connection
authResponsethe key associated with it.

Implements AuthenticationManager.

◆ doesPinMatch()

bool EepromAuthenticatorManager::doesPinMatch ( const char *  pinAttempt)
overridevirtual

Checks if the parameter pinAttempt matches with the one stored within this authentication class.

Parameters
pinAttemptthe pin to be checked
Returns
true if there is a match, otherwise false

Implements AuthenticationManager.

◆ getNumberOfEntries()

int EepromAuthenticatorManager::getNumberOfEntries ( ) const
inline
Returns
the number of spaces for entries in the eeprom

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