TrustedKeyIssuerService

public class TrustedKeyIssuerService : ClaimIssuerService

An implementation of the issuer API for registering with the Trusted Key Demo Issuer.

  • Static reference to the Trusted Key Demo issuer API

    Declaration

    Swift

    public static let shared = TrustedKeyIssuerService(backendUrl: "https://issuer.trustedkey.com/")
  • Request mock claims, for testing during development only. See requestAuthenticIDClaims.

    Declaration

    Swift

    public func requestMockClaims(requestID: String, onSuccess: @escaping () -> Void, onError: @escaping (String) -> Void)
  • Request claims for the credentials with the Trusted Key Demo Issuer. The Trusted Key Demo Issuer uses AuthenticID as the source of the personal information and as such requires the caller to provide a valid AuthenticID transaction ID. This is usually obtained by a previous call to the AuthenticID REST API.

    Upon success, the request has been accepted and the app will be notified when done. Upon failure, the request can be retried by providing the same requestID.

    func requestAuthenticIDClaims(transactionID: String) {
        if self.requestID == nil {
            self.requestID = UUID().uuidString
        }
        self.issuerApi.requestAuthenticIDClaims(requestID: requestID!, catfishAirTransactionID: transactionID, catfishAirVersion: "3", onSuccess: onRegistrationSubmitSucceeded, onError: onRegistrationSubmitFailed)
    }
    

    Declaration

    Swift

    public func requestAuthenticIDClaims(requestID: String, catfishAirTransactionID: String, catfishAirVersion: String, onSuccess: @escaping () -> Void, onError: @escaping (String) -> Void)

    Parameters

    requestID

    A unique ID for this request (for example, an UUID) for retries and notifications.

    catfishAirTransactionID

    A transaction ID, obtained from the AuthenticID REST API.

    catfishAirVersion

    The version of the CatfishAIR REST API to use. Defaults to 1.

    onSuccess

    Success callback, invoked on the main thread.

    onError

    Failure callback , invoked on the main thread with a String error message.

  • Request Trusted Key to issue an email validation claim.

    Declaration

    Swift

    public func requestEmailClaims(requestID: String, emailAddress: String, onSuccess: @escaping () -> Void, onError: @escaping (String) -> Void)

    Parameters

    requestID

    A unique ID for this request (for example, an UUID) for retries and notifications.

    emailAddress

    The email address of the user

    onSuccess

    Success callback, invoked on the main thread.

    onError

    Failure callback , invoked on the main thread with a String error message.

  • Register document images with a unique image ID for later inclusion in a claim request.

    Declaration

    Swift

    public func registerDocumentClaimPhoto(imageId: String, frontImage: Data?, backImage: Data?, onSuccess: @escaping () -> Void, onError: @escaping (String) -> Void)

    Parameters

    imageId

    The unique ID for this request (for example, an UUID)

    frontImage

    Front of document

    backImage

    Back of document

    onSuccess

    Success callback, invoked on the main thread.

    onError

    Failure callback , invoked on the main thread with a String error message.

  • Get the authorization URL for the specified provider.

    Declaration

    Swift

    public func getOpenIdProviders(requestID: String, provider: String, onSuccess: @escaping (URL) -> Void, onError: @escaping (String) -> Void)

    Parameters

    requestID

    A unique ID for this request (for example, an UUID) for retries and notifications.

    provider

    The OpenID provider to request; currently supports facebook and linkedin

    onSuccess

    Success callback, invoked on the main thread.

    onError

    Failure callback , invoked on the main thread with a String error message.

  • Request claims with the specified attributes and optional document images.

    Declaration

    Swift

    public func requestImageClaims(requestID: String, expiry: Date, attr: [OIDs.Dotted:Any], images: [[String:Any]], onSuccess: @escaping () -> Void, onError: @escaping (String) -> Void)

    Parameters

    requestID

    A unique ID for this request (for example, an UUID) for retries and notifications.

    expiry

    The expiry date and time for the issued claims.

    attr

    A map with OID:value pairs.

    images

    An array with images, each with a ["name":"filename","data":"base64-jpeg","oid":"optional oid"] map.

    onSuccess

    Success callback, invoked on the main thread.

    onError

    Failure callback , invoked on the main thread with a String error message.