RelyingPartyUtils

public class RelyingPartyUtils

Functions for relying parties: generate signature requests, invoke wallet app, and validate the response.

  • Build a unique signature request and invoke the wallet app. The nonce for the request is returned and MUST be compared in the response.

    Declaration

    Swift

    public static func invokeSignatureRequest(requiredOids: [String], walletUrl: String, callbackUrl: String) -> String?

    Parameters

    requiredOids

    An array of required OIDs, in dotted notation, or empty if no information is required.

    walletUrl

    The universal link for the wallet application.

    callbackUrl

    The universal link for the relying party application.

    Return Value

    A unique nonce for this request. This nonce must be the same as in the response.

  • The user information object with the information from the wallet. This object is returned by the parseCallbackUniversalLink function.

    See more

    Declaration

    Swift

    public class UserInfo
  • Parse the universal link that was received from the wallet callback.

    Declaration

    Swift

    public static func parseCallbackUniversalLink(_ url: URL) -> UserInfo?

    Parameters

    url

    The URL as received in the continue: NSUserActivity overload in the AppDelegate.

    Return Value

    A UserInfo object with response details, or nil if an error occured.

  • Validate the credential and any claims in the specified user info response.

    Declaration

    Swift

    public static func validateUserInfo(userInfo: UserInfo, onSuccess: @escaping (Bool) -> Void, onError: @escaping (String) -> Void)

    Parameters

    userInfo

    The UserInfo object as received from the parseCallbackUniversalLink function.

    onSuccess

    Success callback, invoked on the main thread when the credential and all claims are valid.

    onError

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