CDC Badge OS
Firmware for the CDC Badge v1.0 hardware security key
Loading...
Searching...
No Matches
cdc::core::AttestationKeyService Class Reference

#include <AttestationKeyService.h>

Inheritance diagram for cdc::core::AttestationKeyService:
cdc::core::IService

Public Member Functions

void setSecureElement (hal::ISecureElement *se)
bool init () override
 Initializes service state.
bool start () override
 Starts service, ensures initialized state, and attempts to provision the attestation key synchronously so dependent module inits (FIDO2 attestation certificate) find it present. Falls back to onTick retries when the secure element is not ready yet.
void stop () override
 Stops attestation-key background processing.
ServiceState getState () const override
const char * getName () const override
void onTick (uint32_t nowMs)
 Periodically attempts to ensure attestation key exists and is valid.
Public Member Functions inherited from cdc::core::IService
virtual ~IService ()=default

Static Public Attributes

static constexpr uint8_t ATTESTATION_ECC_SLOT = 0

Detailed Description

Definition at line 9 of file AttestationKeyService.h.

Member Function Documentation

◆ getName()

const char * cdc::core::AttestationKeyService::getName ( ) const
inlineoverridevirtual

Get service name (for logging/debugging)

Implements cdc::core::IService.

Definition at line 19 of file AttestationKeyService.h.

◆ getState()

ServiceState cdc::core::AttestationKeyService::getState ( ) const
inlineoverridevirtual

Get current service state

Implements cdc::core::IService.

Definition at line 18 of file AttestationKeyService.h.

◆ init()

bool cdc::core::AttestationKeyService::init ( )
overridevirtual

Initializes service state.

Returns
true if service is initialized.

Implements cdc::core::IService.

Definition at line 25 of file AttestationKeyService.cpp.

References cdc::core::INITIALIZED, cdc::core::STARTED, and cdc::core::UNINITIALIZED.

Referenced by start().

◆ onTick()

void cdc::core::AttestationKeyService::onTick ( uint32_t nowMs)

Periodically attempts to ensure attestation key exists and is valid.

Parameters
nowMsCurrent uptime in milliseconds.

Definition at line 63 of file AttestationKeyService.cpp.

References LOG_I, RETRY_INTERVAL_MS, cdc::core::STARTED, and TAG.

◆ setSecureElement()

void cdc::core::AttestationKeyService::setSecureElement ( hal::ISecureElement * se)
inline

Definition at line 13 of file AttestationKeyService.h.

◆ start()

bool cdc::core::AttestationKeyService::start ( )
overridevirtual

Starts service, ensures initialized state, and attempts to provision the attestation key synchronously so dependent module inits (FIDO2 attestation certificate) find it present. Falls back to onTick retries when the secure element is not ready yet.

Returns
true if service is started.

Implements cdc::core::IService.

Definition at line 40 of file AttestationKeyService.cpp.

References init(), LOG_I, cdc::core::STARTED, TAG, and cdc::core::UNINITIALIZED.

◆ stop()

void cdc::core::AttestationKeyService::stop ( )
overridevirtual

Stops attestation-key background processing.

Implements cdc::core::IService.

Definition at line 55 of file AttestationKeyService.cpp.

References cdc::core::STOPPED.

Member Data Documentation

◆ ATTESTATION_ECC_SLOT

uint8_t cdc::core::AttestationKeyService::ATTESTATION_ECC_SLOT = 0
staticconstexpr

Definition at line 11 of file AttestationKeyService.h.


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