ClaimIssuerService

open class ClaimIssuerService

A base implementation of the issuer API. Specific issuer APIs will derive from this class.

  • The error that’s returned in getClaims when the request is still pending.

    Declaration

    Swift

    public static let errPending = "The operation is pending."
  • The error that’s returned by deleteClaims or deleteAllClaims when the deletion failed.

    Declaration

    Swift

    public static let errDeleteFailed  = "Delete failed"
  • The error that’s returned when the server has responded with an empty response.

    Declaration

    Swift

    public static let errJsonWithoutData = "Unexpected: server returned invalid data object."
  • The error that’s returned by getClaims when the server response does not include claims.

    Declaration

    Swift

    public static let errInvalidPemData = "Unexpected: PEM data was invalid."
  • The error that’s returned by getClaims when the server responded with less claims than expected.

    Declaration

    Swift

    public static let errInvalidPemArray = "Unexpected: missing issuer certificate."
  • The error that’s returned by getClaims when a possible duplicate document is found.

    Declaration

    Swift

    public static let errDuplicate = "This is a possible duplicate of a current document."
  • The URL of the backend REST APIs.

    Declaration

    Swift

    public let backendUrl : String
  • Initialize the issuer API with the given backend URL.

    Declaration

    Swift

    public init(backendUrl : String)

    Parameters

    backendUrl

    The URL of the backend REST APIs.

  • Get the claim(s) for the request identified by the given requestID.

    func tryGetClaims() {
        self.issuerApi.getClaims(requestID: self.requestID, onSuccess: { pemArray in
            onRefreshClaimList()
        }, onError: onFailed)
    }
    

    Declaration

    Swift

    open func getClaims(requestID: String?, onSuccess: @escaping (_ pems : [Claim]) -> Void, onError: @escaping (String) -> Void)

    Parameters

    requestID

    The (optional) requestID that was provided during a prior call to the issuer-specific requestClaims API.

    onSuccess

    Success callback, called with an array of decoded claims. This callback is invoked on the main (UI) thread.

    onError

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

  • The results of a call to pollClaim

    See more

    Declaration

    Swift

    public struct ClaimPollResult
  • Get all the pending claim(s) for all requests from this wallet.

    Declaration

    Swift

    open func pollClaims( onSuccess: @escaping (_ pems : ClaimPollResult) -> Void, onError: @escaping (String) -> Void)

    Parameters

    onSuccess

    Success callback, called with a filled ClaimPollResult structure. This callback is invoked on the main (UI) thread.

    onError

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

  • Import pems to keychain.

    Throws

    PemImportException

    Declaration

    Swift

    public static func importPems(pems: String) throws -> [Claim]

    Parameters

    pems

    String of concatenated PEMs.

    Return Value

    array of imported Claim instances

  • Delete the claim(s) for the request identified by the given requestID.

    Declaration

    Swift

    open func deleteClaims(requestID: String, onSuccess: @escaping () -> Void, onError: @escaping (String) -> Void)

    Parameters

    requestID

    The requestID that was provided during a prior call to the issuer-specific requestClaims API.

    onSuccess

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

    onError

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

  • Delete all the claims for the default credential.

    Declaration

    Swift

    open func deleteAllClaims(onSuccess: @escaping () -> Void, onError: @escaping (String) -> Void)

    Parameters

    onSuccess

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

    onError

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