OpenTTD Source  20241108-master-g80f628063a
NetworkAuthenticationDefaultAuthorizedKeyHandler Class Reference

Default implementation for the authorized key handler. More...

#include <network_crypto.h>

Inheritance diagram for NetworkAuthenticationDefaultAuthorizedKeyHandler:
NetworkAuthenticationAuthorizedKeyHandler

Public Member Functions

 NetworkAuthenticationDefaultAuthorizedKeyHandler (const NetworkAuthorizedKeys &authorized_keys)
 Create the handler that uses the given authorized keys to check against. More...
 
bool CanBeUsed () const override
 Check whether the key handler can be used, i.e. More...
 
bool IsAllowed (std::string_view peer_public_key) const override
 Check whether the given public key of the peer is allowed in. More...
 

Private Attributes

const NetworkAuthorizedKeysauthorized_keys
 The authorized keys to check against.
 

Detailed Description

Default implementation for the authorized key handler.

Definition at line 161 of file network_crypto.h.

Constructor & Destructor Documentation

◆ NetworkAuthenticationDefaultAuthorizedKeyHandler()

NetworkAuthenticationDefaultAuthorizedKeyHandler::NetworkAuthenticationDefaultAuthorizedKeyHandler ( const NetworkAuthorizedKeys authorized_keys)
inline

Create the handler that uses the given authorized keys to check against.

Parameters
authorized_keysThe reference to the authorized keys to check against.

Definition at line 169 of file network_crypto.h.

Member Function Documentation

◆ CanBeUsed()

bool NetworkAuthenticationDefaultAuthorizedKeyHandler::CanBeUsed ( ) const
inlineoverridevirtual

Check whether the key handler can be used, i.e.

whether there are authorized keys to check against.

Returns
true when it can be used, otherwise false.

Implements NetworkAuthenticationAuthorizedKeyHandler.

Definition at line 171 of file network_crypto.h.

◆ IsAllowed()

bool NetworkAuthenticationDefaultAuthorizedKeyHandler::IsAllowed ( std::string_view  peer_public_key) const
inlineoverridevirtual

Check whether the given public key of the peer is allowed in.

Parameters
peer_public_keyThe public key of the peer to check against.
Returns
true when the key is allowed, otherwise false.

Implements NetworkAuthenticationAuthorizedKeyHandler.

Definition at line 172 of file network_crypto.h.

References authorized_keys, and NetworkAuthorizedKeys::Contains().


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