class

Matter::Cluster::OperationalCredentialsCluster

Inherits Matter::Cluster::Base < Reference < Object

Operational Credentials Cluster (0x003E)

Functionality to manage operational certificates and fabric membership. This cluster is required for Matter commissioning and fabric management.

Matter Specification: Core 1.4 § 11.17 - Operational Credentials Cluster

Commands:

  • AttestationRequest (0x00): Request device attestation
  • CertificateChainRequest (0x02): Request DAC/PAI certificate
  • CSRRequest (0x04): Request Certificate Signing Request for NOC
  • AddNOC (0x06): Add a Node Operational Certificate
  • UpdateNOC (0x07): Update existing NOC
  • UpdateFabricLabel (0x09): Update fabric label
  • RemoveFabric (0x0A): Remove a fabric
  • AddTrustedRootCertificate (0x0B): Add trusted root CA cert

Attributes:

  • NOCs (0x00): List of NOC certificates
  • Fabrics (0x01): List of fabric descriptors
  • SupportedFabrics (0x02): Maximum supported fabrics
  • CommissionedFabrics (0x03): Current number of fabrics
  • TrustedRootCertificates (0x04): List of trusted root certs
  • CurrentFabricIndex (0x05): Fabric index of current session

Constants

ATTR_COMMISSIONED_FABRICS = 3_u32
ATTR_CURRENT_FABRIC_INDEX = 5_u32
ATTR_FABRICS = 1_u32
ATTR_NOCS = 0_u32

Attributes

ATTR_SUPPORTED_FABRICS = 2_u32
ATTR_TRUSTED_ROOT_CERTIFICATES = 4_u32
CLUSTER_ID = 62_u32
CMD_ADD_NOC = 6_u32
CMD_ADD_TRUSTED_ROOT_CERTIFICATE = 11_u32
CMD_ATTESTATION_REQUEST = 0_u32

Commands

CMD_ATTESTATION_RESPONSE = 1_u32
CMD_CERTIFICATE_CHAIN_REQUEST = 2_u32
CMD_CERTIFICATE_CHAIN_RESPONSE = 3_u32
CMD_CSR_REQUEST = 4_u32
CMD_CSR_RESPONSE = 5_u32
CMD_NOC_RESPONSE = 8_u32
CMD_REMOVE_FABRIC = 10_u32
CMD_UPDATE_FABRIC_LABEL = 9_u32
CMD_UPDATE_NOC = 7_u32

Constructors

new(fabric_table : FabricTable, endpoint_id : DataType::EndpointNumber = DataType::EndpointNumber.new(0_u16), access_control_cluster : AccessControlCluster | Nil = nil, general_commissioning_cluster : GeneralCommissioningCluster | Nil = nil)
Source
new(fabric_table : FabricTable, access_control_cluster : AccessControlCluster)

Overload for tests that pass fabric_table and acl_cluster directly

Source

Class methods

cluster_id

Operational Credentials Cluster (0x003E)

Functionality to manage operational certificates and fabric membership. This cluster is required for Matter commissioning and fabric management.

Matter Specification: Core 1.4 § 11.17 - Operational Credentials Cluster

Commands:

  • AttestationRequest (0x00): Request device attestation
  • CertificateChainRequest (0x02): Request DAC/PAI certificate
  • CSRRequest (0x04): Request Certificate Signing Request for NOC
  • AddNOC (0x06): Add a Node Operational Certificate
  • UpdateNOC (0x07): Update existing NOC
  • UpdateFabricLabel (0x09): Update fabric label
  • RemoveFabric (0x0A): Remove a fabric
  • AddTrustedRootCertificate (0x0B): Add trusted root CA cert

Attributes:

  • NOCs (0x00): List of NOC certificates
  • Fabrics (0x01): List of fabric descriptors
  • SupportedFabrics (0x02): Maximum supported fabrics
  • CommissionedFabrics (0x03): Current number of fabrics
  • TrustedRootCertificates (0x04): List of trusted root certs
  • CurrentFabricIndex (0x05): Fabric index of current session
Source

Instance methods

attributes

Get all attribute metadata

Source
commands

Get all command metadata

Source
commissioned_fabrics

CommissionedFabrics attribute (0x03) - Current number of fabrics

Source
current_fabric_index(session_fabric_index : UInt8 | Nil) : UInt8

CurrentFabricIndex helper method (returns passed value or stored value)

Source
current_fabric_index
Source
current_fabric_index=(current_fabric_index : UInt8)
Source
fabric_index=(value : UInt8 | Nil)

Alias for session_fabric_index to match base Cluster interface The base Cluster.invoke_command sets fabric_index= from the session

Source
fabric_table
Source
fabrics

Fabrics attribute (0x01) - List of all fabric descriptors

Source
failsafe_armed=(failsafe_armed : Bool)
Source
failsafe_armed?
Source
general_commissioning_cluster
Source
general_commissioning_cluster=(general_commissioning_cluster : GeneralCommissioningCluster | Nil)
Source
get_fabric_by_index(index : UInt8) : FabricDescriptor | Nil

Get fabric descriptor by index (for tests)

Source
get_noc_by_fabric_index(index : UInt8) : NOCStruct | Nil

Get NOC by fabric index (for tests)

Source
handle_add_noc(cmd : AddNOCCommand, session_id : UInt64, failsafe_armed : Bool) : NOCResponse

AddNOC command (0x06) Add a Node Operational Certificate (commission into a fabric)

Source
handle_add_trusted_root_certificate(cmd : AddTrustedRootCertificateCommand, failsafe_armed : Bool) : NOCResponse | Nil

AddTrustedRootCertificate command (0x0B) Add a trusted root CA certificate

Source
handle_attestation_request(cmd : AttestationRequestCommand, session_id : UInt64) : AttestationResponse

AttestationRequest command (0x00) Request device attestation during commissioning

Source
handle_certificate_chain_request(cmd : CertificateChainRequestCommand) : CertificateChainResponse

CertificateChainRequest command (0x02) Request DAC or PAI certificate

Source
handle_csr_request(cmd : CSRRequestCommand, session_id : UInt64, is_pase_session : Bool, failsafe_armed : Bool) : CSRResponse | Nil

CSRRequest command (0x04) Generate a Certificate Signing Request for NOC

Source
handle_remove_fabric(cmd : RemoveFabricCommand) : NOCResponse

RemoveFabric command (0x0A) Remove a fabric from the device

Source
handle_update_fabric_label(cmd : UpdateFabricLabelCommand, session_fabric_index : UInt8) : NOCResponse

UpdateFabricLabel command (0x09) Update the label of a fabric

Source
handle_update_noc(cmd : UpdateNOCCommand, session_id : UInt64, session_fabric_index : UInt8, failsafe_armed : Bool) : NOCResponse

UpdateNOC command (0x07) Update an existing NOC certificate

Source
has_fabric_capacity?

Check if there's capacity for more fabrics (for tests)

Source
name

Get cluster name

Source
nocs(fabric_index : UInt8) : Array(NOCStruct)

NOCs attribute (0x00) - Fabric-scoped list of NOC certificates NOCs attribute for specific fabric (0x00)

Source
nocs

Get all NOCs from all fabrics (for tests)

Source
on_fabric_added
Source
on_fabric_added=(on_fabric_added : Proc(Fabric, Nil) | Nil)
Source
on_fabric_removed
Source
on_fabric_removed=(on_fabric_removed : Proc(UInt8, Nil) | Nil)
Source
on_failsafe_armed

New failsafe armed - reset context for new commissioning session This is called by GeneralCommissioning when a new failsafe is created. It ensures that state from a previous commissioning session (like noc_added_or_updated) doesn't interfere with the new session.

Source
on_failsafe_expired

Failsafe timer expired - reset context

Source
on_failsafe_success

Failsafe timer disarmed successfully - commit changes

Source
read_attribute(attribute_id : UInt32, fabric_index : UInt8 | Nil = nil) : InteractionModel::Status | Bytes

CurrentFabricIndex attribute (0x05) - Fabric index from session context

Source
restore_root_cert(root_cert : Bytes)

Restore a root certificate from persisted fabric data Called during device startup to restore TrustedRootCertificates

Source
session_fabric_index
Source
session_fabric_index=(session_fabric_index : UInt8 | Nil)
Source
session_id
Source
session_id=(session_id : UInt64 | Nil)
Source
session_lookup
Source
session_lookup=(session_lookup : Proc(UInt64, Bytes | Nil) | Nil)
Source
set_attestation_credentials(dac : Bytes, pai : Bytes, attestation_key : Crypto::Key)

Configure device attestation credentials Should be called during device initialization with factory credentials

Source
set_attestation_from_manager(vendor_id : UInt16, product_id : UInt16)

Initialize attestation from certificate manager Generates DAC and PAI certificates for the specified vendor/product

Source
supported_fabrics

SupportedFabrics attribute (0x02) - Maximum supported fabrics

Source
trusted_root_certificates

TrustedRootCertificates attribute (0x04) - List of trusted root certs

Source
write_attribute(attribute_id : UInt32, value : Bytes) : InteractionModel::Status

Write an attribute value

Source

Nested types