/**
 * @license
 * Copyright 2022-2026 Matter.js Authors
 * SPDX-License-Identifier: Apache-2.0
 */
import { MatterDefinition } from "../MatterDefinition.js";
import {
  ClusterElement as Cluster,
  AttributeElement as Attribute,
  FieldElement as Field,
  CommandElement as Command,
  DatatypeElement as Datatype
} from "../../elements/index.js";
const TlsCertificateManagement = Cluster(
  { name: "TlsCertificateManagement", id: 2049, classification: "node" },
  Attribute({ name: "ClusterRevision", id: 65533, type: "ClusterRevision", default: 1 }),
  Attribute({
    name: "MaxRootCertificates",
    id: 0,
    type: "uint8",
    access: "R V",
    conformance: "M",
    constraint: "5 to 254",
    quality: "F"
  }),
  Attribute(
    {
      name: "ProvisionedRootCertificates",
      id: 1,
      type: "list",
      access: "R S V",
      conformance: "M",
      constraint: "max maxRootCertificates",
      quality: "N"
    },
    Field({ name: "entry", type: "TLSCertStruct" })
  ),
  Attribute({
    name: "MaxClientCertificates",
    id: 2,
    type: "uint8",
    access: "R V",
    conformance: "M",
    constraint: "2 to 254",
    quality: "F"
  }),
  Attribute(
    {
      name: "ProvisionedClientCertificates",
      id: 3,
      type: "list",
      access: "R S V",
      conformance: "M",
      constraint: "max maxClientCertificates",
      quality: "N"
    },
    Field({ name: "entry", type: "TLSClientCertificateDetailStruct" })
  ),
  Command(
    {
      name: "ProvisionRootCertificate",
      id: 0,
      access: "F A",
      conformance: "M",
      direction: "request",
      quality: "L",
      response: "ProvisionRootCertificateResponse"
    },
    Field({ name: "Certificate", id: 0, type: "octstr", conformance: "M", constraint: "max 3000" }),
    Field({ name: "Caid", id: 1, type: "TLSCAID", conformance: "M", quality: "X" })
  ),
  Command(
    { name: "ProvisionRootCertificateResponse", id: 1, conformance: "M", direction: "response", quality: "L" },
    Field({ name: "Caid", id: 0, type: "TLSCAID", conformance: "M", constraint: "0 to 65534" })
  ),
  Command(
    {
      name: "FindRootCertificate",
      id: 2,
      access: "F O",
      conformance: "M",
      direction: "request",
      quality: "L",
      response: "FindRootCertificateResponse"
    },
    Field({ name: "Caid", id: 0, type: "TLSCAID", conformance: "M", quality: "X" })
  ),
  Command(
    { name: "FindRootCertificateResponse", id: 3, conformance: "M", direction: "response", quality: "L" },
    Field(
      {
        name: "CertificateDetails",
        id: 0,
        type: "list",
        conformance: "M",
        constraint: "1 to maxRootCertificates"
      },
      Field({ name: "entry", type: "TLSCertStruct" })
    )
  ),
  Command(
    {
      name: "LookupRootCertificate",
      id: 4,
      access: "F O",
      conformance: "M",
      direction: "request",
      quality: "L",
      response: "LookupRootCertificateResponse"
    },
    Field({ name: "Fingerprint", id: 0, type: "octstr", conformance: "M", constraint: "max 64" })
  ),
  Command(
    { name: "LookupRootCertificateResponse", id: 5, conformance: "M", direction: "response", quality: "L" },
    Field({ name: "Caid", id: 0, type: "TLSCAID", conformance: "M", constraint: "0 to 65534" })
  ),
  Command(
    {
      name: "RemoveRootCertificate",
      id: 6,
      access: "F A",
      conformance: "M",
      direction: "request",
      quality: "L",
      response: "status"
    },
    Field({ name: "Caid", id: 0, type: "TLSCAID", conformance: "M", constraint: "0 to 65534" })
  ),
  Command(
    {
      name: "ClientCsr",
      id: 7,
      access: "F A",
      conformance: "M",
      direction: "request",
      quality: "L",
      response: "ClientCsrResponse"
    },
    Field({ name: "Nonce", id: 0, type: "octstr", conformance: "M", constraint: "32" }),
    Field({ name: "Ccdid", id: 1, type: "TLSCCDID", conformance: "M", constraint: "0 to 65534", quality: "X" })
  ),
  Command(
    { name: "ClientCsrResponse", id: 8, conformance: "M", direction: "response", quality: "L" },
    Field({ name: "Ccdid", id: 0, type: "TLSCCDID", conformance: "M", constraint: "0 to 65534" }),
    Field({ name: "Csr", id: 1, type: "octstr", conformance: "M", constraint: "max 3000" }),
    Field({ name: "NonceSignature", id: 2, type: "octstr", conformance: "M", constraint: "max 128" })
  ),
  Command(
    {
      name: "ProvisionClientCertificate",
      id: 9,
      access: "F A",
      conformance: "M",
      direction: "request",
      quality: "L",
      response: "status"
    },
    Field({ name: "Ccdid", id: 0, type: "TLSCCDID", conformance: "M", constraint: "0 to 65534" }),
    Field({ name: "ClientCertificate", id: 1, type: "octstr", conformance: "M", constraint: "max 3000" }),
    Field(
      {
        name: "IntermediateCertificates",
        id: 2,
        type: "list",
        conformance: "M",
        constraint: "0 to 10[max 3000]"
      },
      Field({ name: "entry", type: "octstr" })
    )
  ),
  Command(
    {
      name: "FindClientCertificate",
      id: 10,
      access: "F O",
      conformance: "M",
      direction: "request",
      quality: "L",
      response: "FindClientCertificateResponse"
    },
    Field({ name: "Ccdid", id: 0, type: "TLSCCDID", conformance: "M", quality: "X" })
  ),
  Command(
    { name: "FindClientCertificateResponse", id: 11, conformance: "M", direction: "response", quality: "L" },
    Field(
      {
        name: "CertificateDetails",
        id: 0,
        type: "list",
        conformance: "M",
        constraint: "1 to maxClientCertificates"
      },
      Field({ name: "entry", type: "TLSClientCertificateDetailStruct" })
    )
  ),
  Command(
    {
      name: "LookupClientCertificate",
      id: 12,
      access: "F O",
      conformance: "M",
      direction: "request",
      quality: "L",
      response: "LookupClientCertificateResponse"
    },
    Field({ name: "Fingerprint", id: 0, type: "octstr", conformance: "M", constraint: "max 64" })
  ),
  Command(
    { name: "LookupClientCertificateResponse", id: 13, conformance: "M", direction: "response", quality: "L" },
    Field({ name: "Ccdid", id: 0, type: "TLSCCDID", conformance: "M", constraint: "0 to 65534" })
  ),
  Command(
    {
      name: "RemoveClientCertificate",
      id: 14,
      access: "F A",
      conformance: "M",
      direction: "request",
      quality: "L",
      response: "status"
    },
    Field({ name: "Ccdid", id: 0, type: "TLSCCDID", conformance: "M", constraint: "0 to 65534" })
  ),
  Datatype({ name: "TLSCAID", type: "uint16" }),
  Datatype({ name: "TLSCCDID", type: "uint16" }),
  Datatype(
    { name: "TLSCertStruct", type: "struct" },
    Field({ name: "Caid", id: 0, type: "TLSCAID", access: "F", conformance: "M", constraint: "0 to 65534" }),
    Field({ name: "Certificate", id: 1, type: "octstr", access: "F", conformance: "O", constraint: "max 3000" }),
    Field({ name: "FabricIndex", id: 254, type: "FabricIndex" })
  ),
  Datatype(
    { name: "TLSClientCertificateDetailStruct", type: "struct" },
    Field({ name: "Ccdid", id: 0, type: "TLSCCDID", access: "F", conformance: "M", constraint: "0 to 65534" }),
    Field({
      name: "ClientCertificate",
      id: 1,
      type: "octstr",
      access: "F",
      conformance: "O",
      constraint: "max 3000",
      quality: "X"
    }),
    Field(
      {
        name: "IntermediateCertificates",
        id: 2,
        type: "list",
        access: "F",
        conformance: "O",
        constraint: "max 10[max 3000]"
      },
      Field({ name: "entry", type: "octstr" })
    ),
    Field({ name: "FabricIndex", id: 254, type: "FabricIndex" })
  )
);
MatterDefinition.children.push(TlsCertificateManagement);
export {
  TlsCertificateManagement
};
//# sourceMappingURL=tls-certificate-management.element.js.map
