diff --git a/src/controller/BUILD.gn b/src/controller/BUILD.gn index a2b775381fa061..31b83c06bc1d48 100644 --- a/src/controller/BUILD.gn +++ b/src/controller/BUILD.gn @@ -25,8 +25,6 @@ static_library("controller") { "CHIPDevice.h", "CHIPDeviceController.cpp", "CHIPDeviceController.h", - "CHIPOperationalCredentialsProvisioner.cpp", - "CHIPOperationalCredentialsProvisioner.h", "DeviceAddressUpdateDelegate.h", "EmptyDataModelHandler.cpp", "ExampleOperationalCredentialsIssuer.cpp", diff --git a/src/controller/CHIPDeviceController.cpp b/src/controller/CHIPDeviceController.cpp index e43bee247dd0a0..e051096ebea818 100644 --- a/src/controller/CHIPDeviceController.cpp +++ b/src/controller/CHIPDeviceController.cpp @@ -1112,7 +1112,7 @@ CHIP_ERROR DeviceCommissioner::SendOperationalCertificateSigningRequestCommand(D { ChipLogDetail(Controller, "Sending OpCSR request to %p device", device); VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT); - chip::Controller::OperationalCredentialsProvisioner cluster; + chip::Controller::OperationalCredentialsCluster cluster; cluster.Associate(device, 0); Callback::Cancelable * successCallback = mOpCSRResponseCallback.Cancel(); @@ -1212,7 +1212,7 @@ CHIP_ERROR DeviceCommissioner::ProcessOpCSR(const ByteSpan & CSR, const ByteSpan CHIP_ERROR DeviceCommissioner::SendOperationalCertificate(Device * device, const ByteSpan & opCertBuf, const ByteSpan & icaCertBuf) { VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT); - chip::Controller::OperationalCredentialsProvisioner cluster; + chip::Controller::OperationalCredentialsCluster cluster; cluster.Associate(device, 0); Callback::Cancelable * successCallback = mOpCertResponseCallback.Cancel(); @@ -1289,7 +1289,7 @@ CHIP_ERROR DeviceCommissioner::SendTrustedRootCertificate(Device * device) ChipLogProgress(Controller, "Sending root certificate to the device"); - chip::Controller::TrustedRootCertificatesProvisioner cluster; + chip::Controller::TrustedRootCertificatesCluster cluster; cluster.Associate(device, 0); Callback::Cancelable * successCallback = mRootCertResponseCallback.Cancel(); diff --git a/src/controller/CHIPDeviceController.h b/src/controller/CHIPDeviceController.h index 7b638735d8b508..37476362b2bf37 100644 --- a/src/controller/CHIPDeviceController.h +++ b/src/controller/CHIPDeviceController.h @@ -30,8 +30,8 @@ #include #include -#include #include +#include #include #include #include diff --git a/src/controller/CHIPOperationalCredentialsProvisioner.cpp b/src/controller/CHIPOperationalCredentialsProvisioner.cpp deleted file mode 100644 index 9a714717586bf6..00000000000000 --- a/src/controller/CHIPOperationalCredentialsProvisioner.cpp +++ /dev/null @@ -1,374 +0,0 @@ -/* - * - * Copyright (c) 2021 Project CHIP Authors - * All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include -#include - -namespace chip { -namespace Controller { - -CHIP_ERROR OperationalCredentialsProvisioner::AddOpCert(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, chip::ByteSpan noc, - chip::ByteSpan iCACertificate, chip::ByteSpan iPKValue, - chip::NodeId caseAdminNode, uint16_t adminVendorId) -{ - CHIP_ERROR err = CHIP_NO_ERROR; - app::CommandSender * sender = nullptr; - TLV::TLVWriter * writer = nullptr; - uint8_t argSeqNumber = 0; - - VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); - - app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, kAddOpCertCommandId, - (chip::app::CommandPathFlags::kEndpointIdValid) }; - - SuccessOrExit(err = chip::app::InteractionModelEngine::GetInstance()->NewCommandSender(&sender)); - - SuccessOrExit(err = sender->PrepareCommand(&cmdParams)); - - VerifyOrExit((writer = sender->GetCommandDataElementTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - // noc: octetString - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), noc)); - // iCACertificate: octetString - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), iCACertificate)); - // iPKValue: octetString - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), iPKValue)); - // caseAdminNode: nodeId - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), caseAdminNode)); - // adminVendorId: int16u - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), adminVendorId)); - - SuccessOrExit(err = sender->FinishCommand()); - - // #6308: This is a temporary solution before we fully support IM on application side and should be replaced by IMDelegate. - mDevice->AddIMResponseHandler(sender, onSuccessCallback, onFailureCallback); - - err = mDevice->SendCommands(sender); - -exit: - // On error, we are responsible to close the sender. - if (err != CHIP_NO_ERROR) - { - sender->Shutdown(); - } - return err; -} - -CHIP_ERROR OperationalCredentialsProvisioner::OpCSRRequest(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, chip::ByteSpan CSRNonce) -{ - CHIP_ERROR err = CHIP_NO_ERROR; - app::CommandSender * sender = nullptr; - TLV::TLVWriter * writer = nullptr; - uint8_t argSeqNumber = 0; - - VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); - - app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, kOpCSRRequestCommandId, - (chip::app::CommandPathFlags::kEndpointIdValid) }; - - SuccessOrExit(err = chip::app::InteractionModelEngine::GetInstance()->NewCommandSender(&sender)); - - SuccessOrExit(err = sender->PrepareCommand(&cmdParams)); - - VerifyOrExit((writer = sender->GetCommandDataElementTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - - // CSRNonce: octetString - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), CSRNonce)); - - SuccessOrExit(err = sender->FinishCommand()); - - // #6308: This is a temporary solution before we fully support IM on application side and should be replaced by IMDelegate. - mDevice->AddIMResponseHandler(sender, onSuccessCallback, onFailureCallback); - - err = mDevice->SendCommands(sender); - -exit: - // On error, we are responsible to close the sender. - if (err != CHIP_NO_ERROR) - { - sender->Shutdown(); - } - return err; -} - -CHIP_ERROR OperationalCredentialsProvisioner::RemoveAllFabrics(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback) -{ - CHIP_ERROR err = CHIP_NO_ERROR; - app::CommandSender * sender = nullptr; - VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); - - app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, kRemoveAllFabricsCommandId, - (chip::app::CommandPathFlags::kEndpointIdValid) }; - - SuccessOrExit(err = chip::app::InteractionModelEngine::GetInstance()->NewCommandSender(&sender)); - - SuccessOrExit(err = sender->PrepareCommand(&cmdParams)); - - // Command takes no arguments. - - SuccessOrExit(err = sender->FinishCommand()); - - // #6308: This is a temporary solution before we fully support IM on application side and should be replaced by IMDelegate. - mDevice->AddIMResponseHandler(sender, onSuccessCallback, onFailureCallback); - - err = mDevice->SendCommands(sender); - -exit: - // On error, we are responsible to close the sender. - if (err != CHIP_NO_ERROR) - { - sender->Shutdown(); - } - return err; -} - -CHIP_ERROR OperationalCredentialsProvisioner::RemoveFabric(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, chip::FabricId fabricId, - chip::NodeId nodeId, uint16_t vendorId) -{ - CHIP_ERROR err = CHIP_NO_ERROR; - app::CommandSender * sender = nullptr; - TLV::TLVWriter * writer = nullptr; - uint8_t argSeqNumber = 0; - - VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); - - app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, kRemoveFabricCommandId, - (chip::app::CommandPathFlags::kEndpointIdValid) }; - - SuccessOrExit(err = chip::app::InteractionModelEngine::GetInstance()->NewCommandSender(&sender)); - - SuccessOrExit(err = sender->PrepareCommand(&cmdParams)); - - VerifyOrExit((writer = sender->GetCommandDataElementTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - // fabricId: fabricId - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), fabricId)); - // nodeId: nodeId - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), nodeId)); - // vendorId: int16u - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), vendorId)); - - SuccessOrExit(err = sender->FinishCommand()); - - // #6308: This is a temporary solution before we fully support IM on application side and should be replaced by IMDelegate. - mDevice->AddIMResponseHandler(sender, onSuccessCallback, onFailureCallback); - - err = mDevice->SendCommands(sender); - -exit: - // On error, we are responsible to close the sender. - if (err != CHIP_NO_ERROR) - { - sender->Shutdown(); - } - return err; -} - -CHIP_ERROR OperationalCredentialsProvisioner::SetFabric(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t vendorId) -{ - CHIP_ERROR err = CHIP_NO_ERROR; - app::CommandSender * sender = nullptr; - TLV::TLVWriter * writer = nullptr; - uint8_t argSeqNumber = 0; - - VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); - - app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, kSetFabricCommandId, - (chip::app::CommandPathFlags::kEndpointIdValid) }; - - SuccessOrExit(err = chip::app::InteractionModelEngine::GetInstance()->NewCommandSender(&sender)); - - SuccessOrExit(err = sender->PrepareCommand(&cmdParams)); - - VerifyOrExit((writer = sender->GetCommandDataElementTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - // vendorId: int16u - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), vendorId)); - - SuccessOrExit(err = sender->FinishCommand()); - - // #6308: This is a temporary solution before we fully support IM on application side and should be replaced by IMDelegate. - mDevice->AddIMResponseHandler(sender, onSuccessCallback, onFailureCallback); - - err = mDevice->SendCommands(sender); - -exit: - // On error, we are responsible to close the sender. - if (err != CHIP_NO_ERROR) - { - sender->Shutdown(); - } - return err; -} - -CHIP_ERROR OperationalCredentialsProvisioner::UpdateFabricLabel(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, chip::ByteSpan label) -{ - CHIP_ERROR err = CHIP_NO_ERROR; - app::CommandSender * sender = nullptr; - TLV::TLVWriter * writer = nullptr; - uint8_t argSeqNumber = 0; - VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); - - app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, kUpdateFabricLabelCommandId, - (chip::app::CommandPathFlags::kEndpointIdValid) }; - - SuccessOrExit(err = chip::app::InteractionModelEngine::GetInstance()->NewCommandSender(&sender)); - - SuccessOrExit(err = sender->PrepareCommand(&cmdParams)); - - VerifyOrExit((writer = sender->GetCommandDataElementTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - // label: charString - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), label)); - - SuccessOrExit(err = sender->FinishCommand()); - - // #6308: This is a temporary solution before we fully support IM on application side and should be replaced by IMDelegate. - mDevice->AddIMResponseHandler(sender, onSuccessCallback, onFailureCallback); - - err = mDevice->SendCommands(sender); - -exit: - // On error, we are responsible to close the sender. - if (err != CHIP_NO_ERROR) - { - sender->Shutdown(); - } - return err; -} - -// OperationalCredentials Cluster Attributes -CHIP_ERROR OperationalCredentialsProvisioner::DiscoverAttributes(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback) -{ - uint8_t seqNum = mDevice->GetNextSequenceNumber(); - System::PacketBufferHandle encodedCommand = encodeOperationalCredentialsClusterDiscoverAttributes(seqNum, mEndpoint); - return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR OperationalCredentialsProvisioner::ReadAttributeFabricsList(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback) -{ - uint8_t seqNum = mDevice->GetNextSequenceNumber(); - System::PacketBufferHandle encodedCommand = encodeOperationalCredentialsClusterReadFabricsListAttribute(seqNum, mEndpoint); - return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR OperationalCredentialsProvisioner::ReadAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback) -{ - uint8_t seqNum = mDevice->GetNextSequenceNumber(); - System::PacketBufferHandle encodedCommand = encodeOperationalCredentialsClusterReadClusterRevisionAttribute(seqNum, mEndpoint); - return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback); -} - -// TrustedRootCertificates Cluster Commands -CHIP_ERROR TrustedRootCertificatesProvisioner::AddTrustedRootCertificate(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - chip::ByteSpan rootCertificate) -{ - CHIP_ERROR err = CHIP_NO_ERROR; - app::CommandSender * sender = nullptr; - TLV::TLVWriter * writer = nullptr; - uint8_t argSeqNumber = 0; - VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); - - app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, kAddTrustedRootCertificateCommandId, - (chip::app::CommandPathFlags::kEndpointIdValid) }; - - SuccessOrExit(err = chip::app::InteractionModelEngine::GetInstance()->NewCommandSender(&sender)); - - SuccessOrExit(err = sender->PrepareCommand(&cmdParams)); - - VerifyOrExit((writer = sender->GetCommandDataElementTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - // rootCertificate: octetString - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), rootCertificate)); - - SuccessOrExit(err = sender->FinishCommand()); - - // #6308: This is a temporary solution before we fully support IM on application side and should be replaced by IMDelegate. - mDevice->AddIMResponseHandler(sender, onSuccessCallback, onFailureCallback); - - err = mDevice->SendCommands(sender); - -exit: - // On error, we are responsible to close the sender. - if (err != CHIP_NO_ERROR) - { - sender->Shutdown(); - } - return err; -} - -CHIP_ERROR TrustedRootCertificatesProvisioner::RemoveTrustedRootCertificate(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - chip::ByteSpan trustedRootIdentifier) -{ - CHIP_ERROR err = CHIP_NO_ERROR; - app::CommandSender * sender = nullptr; - TLV::TLVWriter * writer = nullptr; - uint8_t argSeqNumber = 0; - - VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); - - app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, kRemoveTrustedRootCertificateCommandId, - (chip::app::CommandPathFlags::kEndpointIdValid) }; - - SuccessOrExit(err = chip::app::InteractionModelEngine::GetInstance()->NewCommandSender(&sender)); - - SuccessOrExit(err = sender->PrepareCommand(&cmdParams)); - - VerifyOrExit((writer = sender->GetCommandDataElementTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - // trustedRootIdentifier: octetString - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), trustedRootIdentifier)); - - SuccessOrExit(err = sender->FinishCommand()); - - // #6308: This is a temporary solution before we fully support IM on application side and should be replaced by IMDelegate. - mDevice->AddIMResponseHandler(sender, onSuccessCallback, onFailureCallback); - - err = mDevice->SendCommands(sender); - -exit: - // On error, we are responsible to close the sender. - if (err != CHIP_NO_ERROR) - { - sender->Shutdown(); - } - return err; -} - -// TrustedRootCertificates Cluster Attributes -CHIP_ERROR TrustedRootCertificatesProvisioner::DiscoverAttributes(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback) -{ - uint8_t seqNum = mDevice->GetNextSequenceNumber(); - System::PacketBufferHandle encodedCommand = encodeTrustedRootCertificatesClusterDiscoverAttributes(seqNum, mEndpoint); - return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR TrustedRootCertificatesProvisioner::ReadAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback) -{ - uint8_t seqNum = mDevice->GetNextSequenceNumber(); - System::PacketBufferHandle encodedCommand = encodeTrustedRootCertificatesClusterReadClusterRevisionAttribute(seqNum, mEndpoint); - return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback); -} - -} // namespace Controller -} // namespace chip diff --git a/src/controller/CHIPOperationalCredentialsProvisioner.h b/src/controller/CHIPOperationalCredentialsProvisioner.h deleted file mode 100644 index 11405a688dbfc2..00000000000000 --- a/src/controller/CHIPOperationalCredentialsProvisioner.h +++ /dev/null @@ -1,103 +0,0 @@ -/* - * - * Copyright (c) 2021 Project CHIP Authors - * All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * @file - * This file contains the definition for CHIP's Operational Credentials - * cluster class. - */ - -#pragma once - -#include -#include -#include - -namespace chip { -namespace Controller { - -typedef void (*OperationalCredentialsClusterOpCSRResponseCallback)(void * context, chip::ByteSpan CSR, chip::ByteSpan CSRNonce, - chip::ByteSpan VendorReserved1, chip::ByteSpan VendorReserved2, - chip::ByteSpan VendorReserved3, chip::ByteSpan Signature); -typedef void (*OperationalCredentialsClusterOpCertResponseCallback)(void * context, uint8_t StatusCode, uint64_t FabricIndex, - uint8_t * DebugText); - -typedef void (*DefaultSuccessCallback)(void * context); -typedef void (*DefaultFailureCallback)(void * context, uint8_t status); - -constexpr ClusterId kOperationalCredentialsClusterIdLocal = 0x003E; -constexpr ClusterId kTrustedRootCertificatesClusterIdLocal = 0x003F; - -class DLL_EXPORT OperationalCredentialsProvisioner : public ClusterBase -{ -public: - OperationalCredentialsProvisioner() : ClusterBase(kOperationalCredentialsClusterIdLocal) {} - ~OperationalCredentialsProvisioner() {} - - // Cluster Commands - CHIP_ERROR AddOpCert(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, chip::ByteSpan noc, - chip::ByteSpan iCACertificate, chip::ByteSpan iPKValue, chip::NodeId caseAdminNode, - uint16_t adminVendorId); - CHIP_ERROR OpCSRRequest(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - chip::ByteSpan cSRNonce); - CHIP_ERROR RemoveAllFabrics(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); - CHIP_ERROR RemoveFabric(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - chip::FabricId fabricId, chip::NodeId nodeId, uint16_t vendorId); - CHIP_ERROR SetFabric(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, uint16_t vendorId); - CHIP_ERROR UpdateFabricLabel(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - chip::ByteSpan label); - - // Cluster Attributes - CHIP_ERROR DiscoverAttributes(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); - CHIP_ERROR ReadAttributeFabricsList(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); - CHIP_ERROR ReadAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); - -private: - static constexpr CommandId kAddOpCertCommandId = 0x06; - static constexpr CommandId kOpCSRRequestCommandId = 0x04; - static constexpr CommandId kRemoveAllFabricsCommandId = 0x0B; - static constexpr CommandId kRemoveFabricCommandId = 0x0A; - static constexpr CommandId kSetFabricCommandId = 0x00; - static constexpr CommandId kUpdateFabricLabelCommandId = 0x09; -}; - -// TODO - Remove TrustedRootCertificate cluster once it merges with OperationalCredentials cluster -// Keeping the code in this file for time being, as it'll eventually be removed. -class DLL_EXPORT TrustedRootCertificatesProvisioner : public ClusterBase -{ -public: - TrustedRootCertificatesProvisioner() : ClusterBase(kTrustedRootCertificatesClusterIdLocal) {} - ~TrustedRootCertificatesProvisioner() {} - - // Cluster Commands - CHIP_ERROR AddTrustedRootCertificate(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - chip::ByteSpan rootCertificate); - CHIP_ERROR RemoveTrustedRootCertificate(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - chip::ByteSpan trustedRootIdentifier); - - // Cluster Attributes - CHIP_ERROR DiscoverAttributes(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); - CHIP_ERROR ReadAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); - -private: - static constexpr CommandId kAddTrustedRootCertificateCommandId = 0x00; - static constexpr CommandId kRemoveTrustedRootCertificateCommandId = 0x01; -}; - -} // namespace Controller -} // namespace chip