Tuya iOS Smart Life App SDK 5.15.0
WTLDeviceControllerStartupParams Class Reference

#import <WTLDeviceControllerStartupParams.h>

Inheritance diagram for WTLDeviceControllerStartupParams:

Instance Methods

(instancetype) - NS_UNAVAILABLE
 
(instancetype) - initWithIPK:fabricID:nocSigner:
 
(instancetype) - initWithIPK:operationalKeypair:operationalCertificate:intermediateCertificate:rootCertificate:
 
(NSNumber *fabricID- API_AVAILABLE
 
(NSNumber *vendorID- API_AVAILABLE
 
(NSNumber *nodeID- API_AVAILABLE
 
(id< WTLOperationalCertificateIssuer > operationalCertificateIssuer) - API_AVAILABLE
 
(dispatch_queue_t operationalCertificateIssuerQueue) - API_AVAILABLE
 
(uint64_t fabricId) - WTL_DEPRECATED
 
(NSNumber *vendorId) - WTL_DEPRECATED
 
(NSNumber *nodeId) - WTL_DEPRECATED
 
(instancetype) - initWithSigningKeypair:fabricId:ipk:
 
(instancetype) - initWithOperationalKeypair:operationalCertificate:intermediateCertificate:rootCertificate:ipk:
 

Class Methods

(instancetype) + NS_UNAVAILABLE
 

Properties

id< WTLKeypairnocSigner
 
NSData * ipk
 
NSSet< NSNumber * > *caseAuthenticatedTags WTL_NEWLY_AVAILABLE
 
WTLCertificateDERBytes rootCertificate
 
WTLCertificateDERBytes intermediateCertificate
 
WTLCertificateDERBytes operationalCertificate
 
id< WTLKeypairoperationalKeypair
 

Detailed Description

Definition at line 26 of file WTLDeviceControllerStartupParams.h.

Method Documentation

◆ API_AVAILABLE [1/5]

- (NSNumber *fabricID) API_AVAILABLE (macos(13.3)) 
(watchos(9.4)) 
(tvos(16.4))   

Fabric id for the controller. Must be set to a nonzero value. This is scoped by the root public key, which is determined as follows:

  • If a root certificate is provided, it is the public key of the root certificate.
  • If a root certificate is not provided, the root public key is the public key of the nocSigner keypair, since in this case we are not using an intermediate certificate.

◆ API_AVAILABLE [2/5]

- (NSNumber *vendorID) API_AVAILABLE (macos(13.3)) 
(watchos(9.4)) 
(tvos(16.4))   

Vendor ID (allocated by the Connectivity Standards Alliance) for this controller.

If not nil, must not be the "standard" vendor id (0).

When creating a new fabric:

  • Must not be nil.

When using an existing fabric:

  • Will override existing value if not nil. Otherwise existing value will be used.

◆ API_AVAILABLE [3/5]

- (NSNumber *nodeID) API_AVAILABLE (macos(13.3)) 
(watchos(9.4)) 
(tvos(16.4))   

Node id for this controller.

If operationalCertificate is not nil, must be nil. The provided operational certificate will be used as-is.

If not nil, must be a valid Matter operational node id.

If operationalCertificate is nil, nodeID and operationalKeypair are used to determine an operational certificate, as follows:

  • When creating a new fabric:

** nodeID is allowed to be nil to indicate that a random node id should be generated.

  • When using an existing fabric:

** nodeID is allowed to be nil to indicate that the existing operational node id should be used. The existing operational keys will also be used, unless operationalKeypair is provided. The existing caseAuthenticatedTags will be used.

** If nodeID is not nil, a new operational certificate will be generated for the provided node id (even if that matches the existing node id), using either the operationalKeypair if that is provided or a new randomly generated operational key, and using the provided caseAuthenticatedTags.

◆ API_AVAILABLE [4/5]

- (id< WTLOperationalCertificateIssuer > operationalCertificateIssuer) API_AVAILABLE (macos(13.3)) 
(watchos(9.4)) 
(tvos(16.4))   

The certificate issuer delegate to use for issuing operational certificates when commmissioning devices. Allowed to be nil if this controller either does not issue operational certificates at all or internally generates the certificates to be issued. In the latter case, nocSigner must not be nil.

◆ API_AVAILABLE [5/5]

- (dispatch_queue_t operationalCertificateIssuerQueue) API_AVAILABLE (macos(13.3)) 
(watchos(9.4)) 
(tvos(16.4))   

The dispatch queue on which operationalCertificateIssuer should be called. Allowed to be nil if and only if operationalCertificateIssuer is nil.

◆ initWithIPK:fabricID:nocSigner:

- (instancetype) initWithIPK: (NSData *)  ipk
fabricID: (NSNumber *)  fabricID
nocSigner: (macos(13.3)) 
(watchos(9.4)) 
(tvos(16.4))  API_AVAILABLE 

Prepare to initialize a controller given a keypair to use for signing operational certificates.

A controller created from WTLDeviceControllerStartupParams initialized with this method will be able to issue operational certificates to devices it commissions, using nocSigner to sign them.

Parameters
ipkThe Identity Protection Key, must be 16 bytes in length
fabricIDThe fabric identifier, must be non-zero.

◆ initWithIPK:operationalKeypair:operationalCertificate:intermediateCertificate:rootCertificate:

- (instancetype) initWithIPK: (NSData *)  ipk
operationalKeypair: (id< WTLKeypair >)  operationalKeypair
operationalCertificate: (WTLCertificateDERBytes operationalCertificate
intermediateCertificate: (WTLCertificateDERBytes _Nullable)  intermediateCertificate
rootCertificate: (macos(13.3)) 
(watchos(9.4)) 
(tvos(16.4))  API_AVAILABLE 

Prepare to initialize a controller that is not able to sign operational certificates itself, and therefore needs to be provided with a complete operational certificate chain. This initialization method should be used when none of the certificate-signing private keys are available locally.

A controller created from WTLDeviceControllerStartupParams initialized with this method will not be able to commission devices unless operationalCertificateIssuer and operationalCertificateIssuerQueue are set.

The fabric id and node id to use for the controller will be derived from the provided operationalCertificate.

Parameters
ipkThe Identity Protection Key, must be 16 bytes in length
intermediateCertificatemay be nil if operationalCertificate is directly signed by rootCertificate.

◆ initWithOperationalKeypair:operationalCertificate:intermediateCertificate:rootCertificate:ipk:

- (instancetype) initWithOperationalKeypair: (id< WTLKeypair >)  operationalKeypair
operationalCertificate: (WTLCertificateDERBytes operationalCertificate
intermediateCertificate: (WTLCertificateDERBytes _Nullable)  intermediateCertificate
rootCertificate: (WTLCertificateDERBytes rootCertificate
ipk: ("Please use initWithIPK:operationalKeypair:operationalCertificate:intermediateCertificate:rootCertificate:") 
(macos(13.0, 13.3)) 
(watchos(9.1, 9.4)) 
(tvos(16.1, 16.4))  WTL_DEPRECATED 

◆ initWithSigningKeypair:fabricId:ipk:

- (instancetype) initWithSigningKeypair: (id< WTLKeypair >)  nocSigner
fabricId: (uint64_t)  fabricId
ipk: ("Please use initWithIPK:fabricID:nocSigner:") 
(macos(13.0, 13.3)) 
(watchos(9.1, 9.4)) 
(tvos(16.1, 16.4))  WTL_DEPRECATED 

◆ NS_UNAVAILABLE [1/2]

- (instancetype) NS_UNAVAILABLE

◆ NS_UNAVAILABLE [2/2]

+ (instancetype) NS_UNAVAILABLE

◆ WTL_DEPRECATED [1/3]

- (uint64_t fabricId) WTL_DEPRECATED ("Please use fabricID") 
(macos(13.0, 13.3)) 
(watchos(9.1, 9.4)) 
(tvos(16.1, 16.4))   

◆ WTL_DEPRECATED [2/3]

- (NSNumber *nodeId) WTL_DEPRECATED ("Please use nodeID") 
(macos(13.0, 13.3)) 
(watchos(9.1, 9.4)) 
(tvos(16.1, 16.4))   

◆ WTL_DEPRECATED [3/3]

- (NSNumber *vendorId) WTL_DEPRECATED ("Please use vendorID") 
(macos(13.0, 13.3)) 
(watchos(9.1, 9.4)) 
(tvos(16.1, 16.4))   

Property Documentation

◆ intermediateCertificate

- (WTLCertificateDERBytes) intermediateCertificate
readwritenonatomiccopy

Intermediate certificate, in X.509 DER form, to use.

If not nil, rootCertificate must not be nil, and the intermediate certificate must be signed by rootCertificate.

If not nil, and nocSigner is not nil, the public key of this certificate must match the public key of nocSigner.

When creating a new fabric:

  • Must not be nil if an intermediate CA is being used.
  • Must be nil if an intermediate CA is not being used.

When using an existing fabric:

  • If not nil, will be used as the intermediate certificate for issuing operational certificates.
  • If nil:
    • If nocSigner is not nil, there is an existing intermediate certificate, and it matches the nocSigner public key, the existing intermediate certificate will be used.
    • Otherwise the fabric will not use an intermediate certificate. This allows switching from using an intermediate CA to not using one.

Definition at line 222 of file WTLDeviceControllerStartupParams.h.

◆ ipk

- (NSData*) ipk
readnonatomiccopy

IPK to use for the controller's fabric. Allowed to change from the last time a controller was started on this fabric if a new IPK has been distributed to all the devices the controller wants to interact with.

Definition at line 98 of file WTLDeviceControllerStartupParams.h.

◆ nocSigner

- (id<WTLKeypair>) nocSigner
readnonatomiccopy

Keypair used to sign operational certificates. This is the root CA keypair if not using an intermediate CA, the intermediate CA's keypair otherwise.

Allowed to be nil if this controller will not be issuing internally-generated operational certificates. In that case, the WTLDeviceControllerStartupParams object must be initialized using initWithIPK:operationalKeypair:operationalCertificate:intermediateCertificate:rootCertificate: (to provide the operational credentials for t2he controller itself).

Definition at line 78 of file WTLDeviceControllerStartupParams.h.

◆ operationalCertificate

- (WTLCertificateDERBytes) operationalCertificate
readnonatomiccopy

Operational certificate, in X.509 DER form, to use.

If not nil, will be used as the operational certificate. In this case operationalKeypair must not be nil.

If nil, an operational certificate will be determined as described in the documentation for nodeID.

Definition at line 233 of file WTLDeviceControllerStartupParams.h.

◆ operationalKeypair

- (id<WTLKeypair>) operationalKeypair
readwritenonatomicstrong

Operational keypair to use. If operationalCertificate is not nil, the public key must match operationalCertificate.

If not nil, and if operationalCertificate is nil, a new operational certificate will be generated for the given operationalKeypair. The node id for that certificate will be determined as described in the documentation for nodeID.

Definition at line 244 of file WTLDeviceControllerStartupParams.h.

◆ rootCertificate

- (WTLCertificateDERBytes) rootCertificate
readwritenonatomiccopy

Root certificate, in X.509 DER form, to use.

Must not be nil if an intermediate CA is being used, to allow determination of the root public key.

If not nil, and if an intermediate CA is not being used, the public key of this certificate must match the public key of nocSigner, if nocSigner is not nil.

When creating a new fabric:

  • May be nil if nocSigner is not nil and an intermediate CA is not being used. In that case the nocSigner keypair, which is the keypair for the root certificate, will be used to generate and sign a root certificate, with a random issuer id. In this case, the fabricID will be included in the root certificate's subject DN.

When using an existing fabric:

  • May be nil if nocSigner is not nil and an intermediate CA is not being used. In that case, the existing root certificate for the fabric will be used.
  • If not nil must satisfy the following properties:

    1) The public key must match the public key of the existing root certificate. 2) The subject DN must match the subject DN of the existing root certificate.

Definition at line 190 of file WTLDeviceControllerStartupParams.h.

◆ WTL_NEWLY_AVAILABLE

- (NSSet<NSNumber *>* caseAuthenticatedTags) WTL_NEWLY_AVAILABLE
readwritenonatomiccopy

CASE authenticated tags to use for this controller's operational certificate.

Only allowed to be not nil if nodeID is not nil. In particular, if operationalCertificate is not nil, must be nil. The provided operational certificate will be used as-is.

If not nil, must contain at most 3 numbers, which are expected to be 32-bit unsigned Case Authenticated Tag values.

Definition at line 157 of file WTLDeviceControllerStartupParams.h.


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