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
See moreparseCallbackUniversalLink
function.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 theAppDelegate
.Return Value
A
UserInfo
object with response details, ornil
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 theparseCallbackUniversalLink
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.