Contents

getSignedIdentityProof(for:using:completionHandler:)

Signs passed-in data with the local device’s private key.

Declaration

func getSignedIdentityProof(for collaborationHighlight: SWCollaborationHighlight, using data: Data, completionHandler: @escaping  @Sendable (SWPerson.SignedIdentityProof?, (any Error)?) -> Void)
func signedIdentityProof(for collaborationHighlight: SWCollaborationHighlight, using data: Data) async throws -> SWPerson.SignedIdentityProof

Parameters

  • collaborationHighlight:

    The collaboration highlight that corresponds to the data.

  • data:

    The NSData that the system signs.

  • completionHandler:

    Returns the signed data along with proof of inclusion for the Merkle tree if signing succeeds, otherwise an error. The system invokes the completion handler on the main thread.

Mentioned in

Discussion

When a collaboration message is sent, the system sends it individually to each of a person’s devices. Messages identifies each device using a cryptographic public key. Since the goal is to allow access only on this set of devices, the root hash is derived from the set of public keys registered to each recipient.

The root hash is the root node of a data structure called a Merkle tree. A Merkle tree is a binary tree that is built by performing a sequence of hashing operations. In order to derive an identity for the user based on their public keys, the keys are used as the leaves of this tree. The hashing algorithm used in the Merkle tree ensures that the root node can only be computed from that set of keys.

See Also

Retrieving collaboration highlights