Interface MTRKeypair


  • public interface MTRKeypair
    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.
    • Method Detail

      • publicKey

        @NotNull
        @NotNull SecKeyRef publicKey()
        Return public key for the keypair.
      • signMessageECDSA_DER

        @NotNull
        default @NotNull NSData signMessageECDSA_DER​(@NotNull
                                                     @NotNull NSData message)
        A function to sign a message using ECDSA
        Parameters:
        message - Message 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 MTRKeypair.
      • signMessageECDSA_RAW

        @NotNull
        default @NotNull NSData signMessageECDSA_RAW​(@NotNull
                                                     @NotNull NSData message)
        A function to sign a message using ECDSA
        Parameters:
        message - Message that needs to be signed
        Returns:
        A signature that consists of: 2 EC elements (r and s), in raw point form (see SEC1). Sometimes also called RFC 4754 form or P1363 form. Either this selector or signMessageECDSA_DER must be supported by a MTRKeypair.