Tuya iOS Smart Life App SDK 5.15.0
<WTLKeypair> Protocol Reference

#import <WTLKeypair.h>

Inheritance diagram for <WTLKeypair>:
WTLIcacKeypair WTLOperationalKeyPair

Instance Methods

(SecKeyRef) - publicKey
 Return public key for the keypair. More...
 
(NSData *) - signMessageECDSA_RAW:
 A function to sign a message using ECDSA. More...
 
(NSData *) - signMessageECDSA_DER:
 A function to sign a message using ECDSA. More...
 

Detailed Description

Copyright (c) 2021 Project CHIP Authors

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. This protocol is used by the Matter framework to sign messages with a private key and verify signatures with a public key.

The Matter framework may call keypair methods from arbitrary threads and concurrently.

Implementations of the keypair methods must not call into any Matter framework APIs.

Definition at line 33 of file WTLKeypair.h.

Method Documentation

◆ publicKey

- (SecKeyRef) publicKey
required

Return public key for the keypair.

◆ signMessageECDSA_DER:

- (NSData *) signMessageECDSA_DER: (NSData *)  message
optional

A function to sign a message using ECDSA.

Parameters
messageMessage that needs to be signed
Returns
An ASN.1 DER-encoded signature (per X9.62).

Either this selector or signMessageECDSA_RAW must be supported by a WTLKeypair.

◆ signMessageECDSA_RAW:

- (NSData *) signMessageECDSA_RAW: (NSData *)  message
optional

A function to sign a message using ECDSA.

Parameters
messageMessage that needs to be signed
Returns
A signature that consists of: 2 EC elements (r and s), in raw <r,s> point form (see SEC1). Sometimes also called RFC 4754 form or P1363 form.

Either this selector or signMessageECDSA_DER must be supported by a WTLKeypair.


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