TrustedKeyRegistryService

public class TrustedKeyRegistryService : CredentialRegistryService

Utility class with wrappers for the Trusted Key Credential Registry API endpoints.

  • Initialize the validation API with the given backend URL.

    Declaration

    Swift

    public init(backendUrl: String, delegateAddress: String)

    Parameters

    backendUrl

    The URL of the backend REST APIs.

    delegateAddress

    The blockchain address of the Trusted Key delegation account.

  • Static reference to the Trusted Key Validation API

    Declaration

    Swift

    public static let shared = TrustedKeyRegistryService(backendUrl: TRUSTEDKEY_REGISTRY_API_URL, delegateAddress: NodeAddressPROD)
  • Revoke our default credential by sending a request to the blockchain. The receiver must have been registered as a delegate in the smart contract. A challenge is signed by the default registered credential, which is verified by the smart contract.

    func revokeIdentity() { trustedKeyRegistryApi.revokeDefaultCredential(onSuccess: { _ in }, onError: { _ in }) }

    Declaration

    Swift

    public func revokeDefaultCredential(onSuccess: @escaping (TransactionID) -> Void, onError: @escaping (String) -> Void)

    Parameters

    onSuccess

    Success callback, invoked on the main (UI) thread.

    onError

    Failure callback, invoked with error message, on the main (UI) thread.