Performs certificate validation. More...
#include <ValidatorList.h>
Public Member Functions | |
bool | add (Validator *validator) |
Add a validator to the list. More... | |
template<class T > | |
bool | pin (const T &fingerprint) |
Pin a fingerprint. More... | |
bool | add (ValidatorCallback callback, void *data=nullptr) |
Register a custom validator callback. More... | |
bool | validate (const Certificate *certificate) |
Validate certificate via registered validators. More... | |
![]() | |
Vector (unsigned int initialCapacity=10, unsigned int capacityIncrement=10) | |
Vector (const Vector &rhv) | |
unsigned int | capacity () const |
bool | contains (const Validator &elem) const |
const Validator & | firstElement () const |
int | indexOf (const Validator &elem) const |
bool | isEmpty () const |
const Validator & | lastElement () const |
int | lastIndexOf (const Validator &elem) const |
unsigned int | count () const override |
unsigned int | size () const |
void | copyInto (Validator *array) const |
bool | add (const Validator &obj) |
bool | addElement (const Validator &obj) |
bool | addElement (Validator *objp) |
void | clear () |
bool | ensureCapacity (unsigned int minCapacity) |
void | removeAllElements () |
bool | removeElement (const Validator &obj) |
bool | setSize (unsigned int newSize) |
Reduce or increase number of items. More... | |
void | trimToSize () |
Reduce capacity to match current size. More... | |
const Validator & | elementAt (unsigned int index) const |
bool | insertElementAt (const Validator &obj, unsigned int index) |
bool | remove (unsigned int index) |
bool | removeElementAt (unsigned int index) |
bool | setElementAt (const Validator &obj, unsigned int index) |
const Validator & | get (unsigned int index) const |
const Validator & | operator[] (unsigned int index) const override |
Validator & | operator[] (unsigned int index) override |
const Vector< Validator > & | operator= (const Vector< Validator > &rhv) |
const Vector< Validator > & | operator= (Vector< Validator > &&other) noexcept |
void | sort (Comparer compareFunction) |
Iterator< false > | begin () |
const Iterator< true > | begin () const |
Iterator< false > | end () |
const Iterator< true > | end () const |
![]() | |
virtual | ~Countable () |
const Validator & | at (unsigned int i) const |
Public Attributes | |
Fingerprint::Types | fingerprintTypes |
Contains a list of registered fingerprint types. More... | |
Additional Inherited Members | |
![]() | |
using | Comparer = int(*)(const Validator &lhs, const Validator &rhs) |
![]() | |
using | ElementList = wiring_private::List< Validator > |
![]() | |
void | copyFrom (const Vector &rhv) |
![]() | |
unsigned int | _size |
unsigned int | _increment |
ElementList | _data |
Detailed Description
Performs certificate validation.
Validators are created in the application's session initialisation callback. When the certificate has been received, it is checked against each registered validator in turn until successful. All validators are destroyed during this process.
If there are no validators in the list then the certificate will not be checked and the connection accepted.
Member Function Documentation
◆ add() [1/2]
Add a validator to the list.
- Parameters
-
validator Must be allocated on the heap
◆ add() [2/2]
|
inline |
Register a custom validator callback.
- Parameters
-
callback data User-provided data (optional)
◆ pin()
|
inline |
Pin a fingerprint.
Creates and adds a fingerprint validator to the list
◆ validate()
bool Ssl::ValidatorList::validate | ( | const Certificate * | certificate | ) |
Validate certificate via registered validators.
- Parameters
-
certificate When called with nullptr will free all validators, then fail
- Return values
-
bool true on success, false on failure
- Note
- Called by SSL framework.
We only need one match for a successful result, but we free all the validators. This method must be called no more than ONCE.
Member Data Documentation
◆ fingerprintTypes
Fingerprint::Types Ssl::ValidatorList::fingerprintTypes |
Contains a list of registered fingerprint types.
Allows implementations to avoid calculating fingerprint values which are not required, as this is computationally expensive.
The documentation for this class was generated from the following file: