nl:: Weave:: Profiles:: Security:: CertProvisioning:: WeaveCertProvEngine
#include <src/lib/profiles/security/WeaveCertProvisioning.h>
Implements the core logic of the Weave Certificate Provisioning protocol object.
Summary
Constructors and Destructors |
|
---|---|
WeaveCertProvEngine(void)
|
Public types |
|
---|---|
@246{
|
enum |
EventCallback)(void *appState, EventType eventType, const InEventParam &inParam, OutEventParam &outParam)
|
typedefvoid(*
This function is the application callback that is invoked on Certificate Provisioning Engine API events. |
EventType{
|
enum |
State{
|
enum |
Public attributes |
|
---|---|
AppState
|
void *
A pointer to application-specific data.
|
Public functions |
|
---|---|
AbortCertificateProvisioning(void)
|
void
Stops any GetCertificate exchange in progress.
|
GenerateGetCertificateRequest(PacketBuffer *msgBuf, uint8_t reqType, bool doMfrAttest)
|
Generate GetCertificateRequest message.
|
GetBinding(void) const
|
Binding *
Returns a pointer to the Binding object associated with the WeaveCertProvEngine.
|
GetEventCallback(void) const
|
Returns a pointer to the API event callback function currently configured on the WeaveCertProvEngine object.
|
GetMfrAttestDelegate(void) const
|
Returns a pointer to the manufacturer attestation delegate object currently configured on the WeaveCertProvEngine object.
|
GetOpAuthDelegate(void) const
|
Returns a pointer to the operational authentication delegate object currently configured on the WeaveCertProvEngine object.
|
GetReqType(void) const
|
uint8_t
Retrieve the current request type.
|
GetState(void) const
|
Retrieve the current state of the WeaveCertProvEngine object.
|
Init(Binding *binding, WeaveNodeOpAuthDelegate *opAuthDelegate, WeaveNodeMfrAttestDelegate *mfrAttestDelegate, EventCallback eventCallback, void *appState)
|
Initialize a WeaveCertProvEngine object in preparation for sending get certificate request message.
|
ProcessGetCertificateResponse(PacketBuffer *msgBuf)
|
Process GetCertificateResponse message.
|
SetBinding(Binding *binding)
|
void
Sets the binding object on the WeaveCertProvEngine object.
|
SetEventCallback(EventCallback eventCallback)
|
void
Sets the API event callback function on the WeaveCertProvEngine object.
|
SetMfrAttestDelegate(WeaveNodeMfrAttestDelegate *mfrAttestDelegate)
|
void
Sets the manufacturer attestation delegate object on the WeaveCertProvEngine object.
|
SetOpAuthDelegate(WeaveNodeOpAuthDelegate *opAuthDelegate)
|
void
Sets the operational authentication delegate object on the WeaveCertProvEngine object.
|
Shutdown(void)
|
void
Shutdown a previously initialized WeaveCertProvEngine object.
|
StartCertificateProvisioning(uint8_t reqType, bool doMfrAttest)
|
Start Certificate Provisioning Protocol.
|
Structs |
|
---|---|
nl:: |
Input parameters to Weave Certificate Provisioning API event. |
nl:: |
Output parameters to Weave Certificate Provisioning API event. |
Public types
@246
@246
EventCallback
void(* EventCallback)(void *appState, EventType eventType, const InEventParam &inParam, OutEventParam &outParam)
This function is the application callback that is invoked on Certificate Provisioning Engine API events.
Details | |||||||||
---|---|---|---|---|---|---|---|---|---|
Parameters |
|
EventType
EventType
State
State
Public attributes
AppState
void * AppState
A pointer to application-specific data.
Public functions
AbortCertificateProvisioning
void AbortCertificateProvisioning( void )
Stops any GetCertificate exchange in progress.
GenerateGetCertificateRequest
WEAVE_ERROR GenerateGetCertificateRequest( PacketBuffer *msgBuf, uint8_t reqType, bool doMfrAttest )
Generate GetCertificateRequest message.
This method generates Weave GetCertificateRequest structure encoded in the Weave TLV format.
When forming the GetCertificateRequest message, the method makes a request to the application, via WeaveNodeOpAuthDelegate and WeaveNodeMfrAttestDelegate functions and the PrepareAuthorizeInfo API event, to prepare the payload of the message.
Details | |||||||
---|---|---|---|---|---|---|---|
Parameters |
|
||||||
Return Values |
|
GetBinding
Binding * GetBinding( void ) const
Returns a pointer to the Binding object associated with the WeaveCertProvEngine.
GetEventCallback
EventCallback GetEventCallback( void ) const
Returns a pointer to the API event callback function currently configured on the WeaveCertProvEngine object.
GetMfrAttestDelegate
WeaveNodeMfrAttestDelegate * GetMfrAttestDelegate( void ) const
Returns a pointer to the manufacturer attestation delegate object currently configured on the WeaveCertProvEngine object.
GetOpAuthDelegate
WeaveNodeOpAuthDelegate * GetOpAuthDelegate( void ) const
Returns a pointer to the operational authentication delegate object currently configured on the WeaveCertProvEngine object.
GetReqType
uint8_t GetReqType( void ) const
Retrieve the current request type.
Init
WEAVE_ERROR Init( Binding *binding, WeaveNodeOpAuthDelegate *opAuthDelegate, WeaveNodeMfrAttestDelegate *mfrAttestDelegate, EventCallback eventCallback, void *appState )
Initialize a WeaveCertProvEngine object in preparation for sending get certificate request message.
Details | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Parameters |
|
ProcessGetCertificateResponse
WEAVE_ERROR ProcessGetCertificateResponse( PacketBuffer *msgBuf )
Process GetCertificateResponse message.
This method processes Weave GetCertificateResponse structure encoded in the Weave TLV format.
When processing of the GetCertificateResponse message is complete successfully, the method makes a call to the application, via the ResponseReceived API event, to deliver the result.
If processing of the GetCertificateResponse message fails, the method makes a call to the application, via the CommunicationError API event, to report the error.
Details | |||
---|---|---|---|
Parameters |
|
||
Return Values |
|
SetBinding
void SetBinding( Binding *binding )
Sets the binding object on the WeaveCertProvEngine object.
SetEventCallback
void SetEventCallback( EventCallback eventCallback )
Sets the API event callback function on the WeaveCertProvEngine object.
SetMfrAttestDelegate
void SetMfrAttestDelegate( WeaveNodeMfrAttestDelegate *mfrAttestDelegate )
Sets the manufacturer attestation delegate object on the WeaveCertProvEngine object.
SetOpAuthDelegate
void SetOpAuthDelegate( WeaveNodeOpAuthDelegate *opAuthDelegate )
Sets the operational authentication delegate object on the WeaveCertProvEngine object.
Shutdown
void Shutdown( void )
Shutdown a previously initialized WeaveCertProvEngine object.
Note that this method can only be called if the Init() method has been called previously.
StartCertificateProvisioning
WEAVE_ERROR StartCertificateProvisioning( uint8_t reqType, bool doMfrAttest )
Start Certificate Provisioning Protocol.
This method initiates the process of sending a GetCertificateRequest message to the CA service. If and when a corresponding GetCertificateResponse message is received it will be delivered to the application via the ResponseReceived API event.
If the Binding object is not in the Ready state when this method is called, a request will be made to Binding::RequestPrepare() method to initiate on-demand preparation. The request operation will then be waiting until this process completes. Any call to StartCertificateProvisioning() while there is a previous request in process will be ignored.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Return Values |
|
WeaveCertProvEngine
WeaveCertProvEngine( void )