EosioReferenceAuthenticatorSignatureProvider
public class EosioReferenceAuthenticatorSignatureProvider : EosioSignatureProviderProtocol
Signature provider for EOSIO SDK for Swift that provides selective disclosure and transaction signing using the
EOSIO Reference iOS Authenticator App. Conforms to EosioSignatureProviderProtocol.
Requirements for developers.
- Add manifest.json file.
- Add URL scheme or Universal Link.
- Add URL scheme to whitelist.
-
Singleton instance of the
EosioReferenceAuthenticatorSignatureProvider.Declaration
Swift
public static let shared: EosioReferenceAuthenticatorSignatureProvider -
Handle an incoming request from a Universal Link.
Declaration
Swift
public static func handleIncoming(userActivity: NSUserActivity)Parameters
userActivityCurrent application state as
NSUserActivity. -
Handle an incoming request from a custom URL scheme.
Declaration
Swift
public static func handleIncoming(url: URL)Parameters
urlThe URL passed in from the system handler that the app has registered.
-
If true the incoming request requires biometric authentication to be processed.
Declaration
Swift
public var requireBiometric: Bool -
The return URL of the request.
Declaration
Swift
public var returnUrl: String -
The call back URL of the request.
Declaration
Swift
public var callbackUrl: String? -
The declared domain of the request.
Declaration
Swift
public var declaredDomain: String? -
The application manifest of the request.
Declaration
Swift
public var manifest: String? -
Security checks or rules to relax during processing of the current request.
Declaration
Swift
public var securityExclusions: SecurityExclusions? -
The incoming request structure to handle.
See moreDeclaration
Swift
public struct Request : Codable -
Request Payload native struct.
See moreDeclaration
Swift
public struct RequestPayload : Codable -
Returned response structure for processed request.
See moreDeclaration
Swift
public struct Response : Codable -
Response Payload native struct.
See moreDeclaration
Swift
public struct ResponsePayload : Codable
-
Handle selective disclosures in the payload, caching data and call completion.
Declaration
Swift
public static func handleIncomingSelectiveDisclosure(payload: ResponsePayload)Parameters
payloadThe selective disclosure
ResponsePayload -
The type of selective disclosure.
See moreDeclaration
Swift
public enum SelectiveDisclosureType : String, Codable -
Single disclosure request.
See moreDeclaration
Swift
public struct Disclosure : Codable -
Selective disclosure request. Can contain multiple disclosures in a single request.
See moreDeclaration
Swift
public struct SelectiveDisclosureRequest : Codable -
Selective disclosure response.
See moreDeclaration
Swift
public struct SelectiveDisclosureResponse : Codable -
Authorizer information returned in selective disclosure.
See moreDeclaration
Swift
public struct Authorizer : Codable -
Request selective disclosure from the EOSIO Reference iOS Authenticator App. Opens the EOSIO Reference iOS Authenticator App and asks the user for permission.
Declaration
Swift
public func requestSelectiveDisclosure(_ request: SelectiveDisclosureRequest, completion: @escaping (SelectiveDisclosureResponse) -> Void)Parameters
requestThe
SelectiveDisclosureRequestbeing sent to the EOSIO Reference iOS Authenticator App.completionThe completion closure to be called with the
SelectiveDisclosureResponse. -
Get the list of keys from the available authorizers. Required to conform to
EosioSignatureProviderProtocol.Declaration
Swift
public func getAvailableKeys(completion: @escaping (EosioAvailableKeysResponse) -> Void)Parameters
completionClosure to call with the
EosioAvailableKeysResponse. -
Request authorizers from the EOSIO Reference iOS Authenticator App. Opens the EOSIO Reference iOS Authenticator App and asks the user for permission.
Declaration
Swift
public func requestAuthorizers(completion: @escaping (SelectiveDisclosureResponse) -> Void)Parameters
completionThe completion closure to be called with the
SelectiveDisclosureResponse. -
Returns the cache of the last
requestAuthorizerscall if present. Otherwise, requests authorizers from the EOSIO Reference iOS Authenticator App.Remark
In the future, updated authorizers could be retrieved from a server with a token returned from the last
requestAuthorizerscall. Updated authorizers can also be included with each transaction response.Declaration
Swift
public func getAuthorizers(completion: @escaping (SelectiveDisclosureResponse) -> Void)
-
Clear the authorizers in the local cache.
Declaration
Swift
public func clearAuthorizers() throws -
Read authorizers file from cache.
Throws
If there is an error building the authorizers URL or decoding the cached authorizers JSON.Declaration
Swift
public func getAuthorizers() throws -> [Authorizer]Return Value
ArrayofAuthorizer.
-
Handle transaction signature requests in the payload.
Declaration
Swift
public static func handleIncomingTransactionSignature(payload: ResponsePayload)Parameters
payloadThe transaction signature
ResponsePayload. -
The structure for
See moreEosioReferenceAuthenticatorSignatureProvider.TransactionSignatureRequest.Transaction.Declaration
Swift
public struct Transaction : Codable -
The transaction signature request. Conforms to the
See moretransactionSignatureproperty of the request protocol at: https://github.com/EOSIO/eosio-authentication-transport-protocol-specDeclaration
Swift
public struct TransactionSignatureRequest : Codable -
The structure for the
See moreEosioReferenceAuthenticatorSignatureProvider.TransactionSignatureResponse. Conforms to thetransactionSignatureproperty of the response protocol at: https://github.com/EOSIO/eosio-authentication-transport-protocol-specDeclaration
Swift
public struct TransactionSignatureResponse : Codable -
Sign transaction implementation method. Required to conform to
EosioSignatureProviderProtocol.Declaration
Swift
public func signTransaction(request: EosioTransactionSignatureRequest, completion: @escaping (EosioTransactionSignatureResponse) -> Void)Parameters
requestThe
EosioTransactionSignatureRequestbeing sent to the EOSIO Reference iOS Authenticator App.completionThe completion closure to be called with the
EosioTransactionSignatureResponse.
View on GitHub
EosioReferenceAuthenticatorSignatureProvider Class Reference