API

CLASS

API

public class API

Execute networking request against MIRACL platform

Methods

init(sdkConfiguration:)

public init(sdkConfiguration: Configuration) throws

registerUser(for:deviceName:activationToken:completionHandler:)

@objc public func registerUser(
    for userId: String,
    deviceName: String,
    activationToken: ActivationToken,
    completionHandler:
        @escaping (APICallResult,
                   RegistrationResponse?,
                   Error?) -> Void
)

Registering user

  • Parameters:
    • userId: id
    • deviceName: device name
    • activationToken: code
    • completionHandler: handler

Parameters

Name Description
userId id
deviceName device name
activationToken code
completionHandler handler

signature(for:regOTT:completionHandler:)

@objc public func signature(
    for mpinId: String,
    regOTT: String,
    completionHandler: @escaping (APICallResult, SignatureResponse?, Error?) -> Void
)

Creates signature

  • Parameters:
    • mpinId: mpinid
    • regOTT: regott
    • completionHandler: completion handler

Parameters

Name Description
mpinId mpinid
regOTT regott
completionHandler completion handler

getClientSecret2(for:completionHandler:)

@objc public func getClientSecret2(
    for cs2URL: URL,
    completionHandler:@escaping (
        APICallResult,
        ClientSecretResponse?,
        Error?) -> Void
)

Getting second client secret share

  • Parameters:
    • cs2URL: url
    • completionHandler: completion handler

Parameters

Name Description
cs2URL url
completionHandler completion handler

pass1(for:mpinId:publicKey:uValue:scope:completionHandler:)

@objc public func pass1(
    for dtas: String,
    mpinId: String,
    publicKey: String?,
    uValue: String,
    scope: [String],
    completionHandler:@escaping (APICallResult, Pass1Response?, Error?) -> Void)

Server pass1

  • Parameters:
    • dtas: dtas
    • mpinId: mpinid
    • publicKey: publickey
    • uValue: u
    • scope: scoper
    • completionHandler: completion handler

Parameters

Name Description
dtas dtas
mpinId mpinid
publicKey publickey
uValue u
scope scoper
completionHandler completion handler

pass2(for:accessId:vValue:completionHandler:)

@objc public func pass2(
    for mpinId: String,
    accessId: String?,
    vValue: String,
    completionHandler:@escaping (APICallResult, Pass2Response?, Error?) -> Void
)

Server pass 2

  • Parameters:
    • mpinId: mpinid
    • accessId: accessid
    • vValue: vvalue
    • completionHandler: completion handler

Parameters

Name Description
mpinId mpinid
accessId accessid
vValue vvalue
completionHandler completion handler

authenticate(authOTT:completionHandler:)

@objc public func authenticate(
    authOTT: String,
    completionHandler:@escaping (APICallResult, AuthenticateResponse?, Error?) -> Void
)

Authenticate

  • Parameters:
    • authOTT: authentication token
    • completionHandler: completion handler

Parameters

Name Description
authOTT authentication token
completionHandler completion handler

signingClientSecret1(publicKey:signingRegistrationToken:deviceName:completionHandler:)

@objc public func signingClientSecret1(
    publicKey: String,
    signingRegistrationToken: String,
    deviceName: String,
    completionHandler:@escaping (APICallResult, SigningClientSecret1Response?, Error?) -> Void
)

Get client secret 1 for signing

  • Parameters:
    • publicKey: public key
    • signingRegistrationToken: token
    • deviceName: device identifier into the portal application.
    • completionHandler: completion handler

Parameters

Name Description
publicKey public key
signingRegistrationToken token
deviceName device identifier into the portal application.
completionHandler completion handler

signingClientSecret2(for:completionHandler:)

@objc public func signingClientSecret2(
    for cs2URL: URL,
    completionHandler:@escaping (APICallResult, SigningClientSecret2Response?, Error?) -> Void
)

Get signing client secret 2

  • Parameters:
    • cs2URL: url
    • completionHandler: completion handler

Parameters

Name Description
cs2URL url
completionHandler completion handler

verifyUser(for:deviceName:clientId:accessId:completionHandler:)

@objc public func verifyUser(
    for userId: String,
    deviceName: String,
    clientId: String,
    accessId: String,
    completionHandler:@escaping (APICallResult, VerificationResponse?, Error?) -> Void
)

Sending request for verifying user identity.

  • Parameters:
    • userId: id of the user.
    • deviceName: a device identifier used to recognise device in the portal.
    • clientId: id of the client.
    • accessId: a session identifier used to get information from web session.
    • completionHandler: completion handler.

Parameters

Name Description
userId id of the user.
deviceName a device identifier used to recognise device in the portal.
clientId id of the client.
accessId a session identifier used to get information from web session.
completionHandler completion handler.

confirmVerificationRequest(userId:code:completionHandler:)

@objc public func confirmVerificationRequest(
    userId: String,
    code: String,
    completionHandler:@escaping (APICallResult, VerificationConfirmationResponse?, Error?) -> Void
)

Sending request for confirming user identity verification.

  • Parameters:
    • userId: id of the user.
    • code: activation code.
    • completionHandler: completion handler.

Parameters

Name Description
userId id of the user.
code activation code.
completionHandler completion handler.