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 var shared = TrustedKeyIssuerService(backendUrl: "https://issuer.trustedkey.com/")
  • Undocumented

    Declaration

    Swift

    public static let errFailed = "Unexpected data"
  • Undocumented

    Declaration

    Swift

    public static let errPhoneVerificationFailed = "Phone number verification failed"
  • Undocumented

    Declaration

    Swift

    public static let errPhoneNumberInvalid = "Phone number is invalid"
  • 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, onSuccess: onRegistrationSubmitSucceeded, onError: onRegistrationSubmitFailed)
    }
    

    Declaration

    Swift

    public func requestAuthenticIDClaims(requestID: String, catfishAirTransactionID: 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.

    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:String]], 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.

  • Via

    Used by requestPhoneNumberVerification function to specify deliovery type of the token

    See more

    Declaration

    Swift

    public enum Via: String
  • Request Trusted Key to register a phone number.

    Declaration

    Swift

    public func requestPhoneNumberVerification(phoneNumber: String, countryCode: String, via: Via, onSuccess: @escaping () -> Void, onError: @escaping (String) -> Void)

    Parameters

    phoneNumber

    The users phone number

    countryCode

    The country code of the phone number (US is 1)

    via

    ‘sms’ for text verification, ‘call’ for phone call verification

    onSuccess

    Success callback, invoked on the main thread.

    onError

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

  • Manual verification of the phone number.

    Declaration

    Swift

    public func verifyPhoneNumber(phoneNumber: String, countryCode: String, token: String, onSuccess: @escaping () -> Void, onError: @escaping (String) -> Void)

    Parameters

    phoneNumber

    The users phone number

    countryCode

    The country code of the phone number (US is 1)

    token

    The 4 digit number from the verification text

    onSuccess

    Success callback, invoked on the main thread.

    onError

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

  • Opt-in or -out of detailed logging, which may contain PII.

    Declaration

    Swift

    public func logOptIn(optin: Bool, onSuccess: @escaping (Bool) -> Void, onError: @escaping (String) -> Void)

    Parameters

    optin

    Whether to turn logging on (true) or off (false).

    onSuccess

    Success callback, invoked on the main thread.

    onError

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