MIRACLTrust

# MIRACLTrust


class MIRACLTrust

MIRACL Trust is the entry point of the MIRACL Trust SDK. It is configured and connects with the MIRACLTrust Platform on its initialization.

Initialization is done through configure(context,configuration). After initialization, the SDK can be accessed through getInstance().

# Types

Name Summary
Companion
object Companion

# Properties

Name Summary
users
var users: List<User>
The registered user identities, stored inside the user storage

# Functions

Name Summary
abortAuthenticationSession
fun abortAuthenticationSession(authenticationSessionDetails: AuthenticationSessionDetails, resultHandler: ResultHandler<Unit, AuthenticationSessionException>)
Cancel the authentication session.
authenticate
fun authenticate(user: User, pinProvider: PinProvider, resultHandler: ResultHandler<String, AuthenticationException>)
Generate an authentication code for a registered user.
authenticateWithAppLink
fun authenticateWithAppLink(user: User, appLink: Uri, pinProvider: PinProvider, resultHandler: ResultHandler<Unit, AuthenticationException>)
Authenticate identity in the MIRACL platform.
authenticateWithNotificationPayload
fun authenticateWithNotificationPayload(payload: Map<String, String>, pinProvider: PinProvider, resultHandler: ResultHandler<Unit, AuthenticationException>)
Authenticate identity in the MIRACL platform.
authenticateWithQRCode
fun authenticateWithQRCode(user: User, qrCode: String, pinProvider: PinProvider, resultHandler: ResultHandler<Unit, AuthenticationException>)
Authenticate identity in the MIRACL platform.
completeSigningSession
fun completeSigningSession(signingSessionDetails: SigningSessionDetails, signature: Signature, timestamp: Date, resultHandler: ResultHandler<SigningSessionStatus, SigningSessionException>)
Complete signing session with returning signature and its timestamp to the MIRACL Platform.
delete
fun delete(user: User)
Delete a registered user.
generateOTP
fun generateOTP(user: User, pinProvider: PinProvider, resultHandler: ResultHandler<OTP, AuthenticationException>)
Generate OTP for a registered authentication user.
generateQuickCode
fun generateQuickCode(user: User, pinProvider: PinProvider, resultHandler: ResultHandler<QuickCode, AuthenticationException>)
Generate QuickCode for a registered authentication user.
getActivationToken
fun getActivationToken(verificationUri: Uri, resultHandler: ResultHandler<ActivationTokenResponse, ActivationTokenException>)
The method confirms user verification and as a result, an activation token is obtained. This activation token should be used in the registration process.
getAuthenticationSessionDetailsFromAppLink
fun getAuthenticationSessionDetailsFromAppLink(appLink: Uri, resultHandler: ResultHandler<AuthenticationSessionDetails, AuthenticationSessionException>)
Get authentication session details for project in MIRACL platform based on authentication session identifier.
getAuthenticationSessionDetailsFromNotificationPayload
fun getAuthenticationSessionDetailsFromNotificationPayload(payload: Map<String, String>, resultHandler: ResultHandler<AuthenticationSessionDetails, AuthenticationSessionException>)
Get authentication session details for project in MIRACL platform based on authentication session identifier.
getAuthenticationSessionDetailsFromQRCode
fun getAuthenticationSessionDetailsFromQRCode(qrCode: String, resultHandler: ResultHandler<AuthenticationSessionDetails, AuthenticationSessionException>)
Get authentication session details for project in MIRACL platform based on authentication session identifier.
getSigningSessionDetailsFromAppLink
fun getSigningSessionDetailsFromAppLink(appLink: Uri, resultHandler: ResultHandler<SigningSessionDetails, SigningSessionException>)
Get signing session details from MIRACL platform based on session identifier.
getSigningSessionDetailsFromQRCode
fun getSigningSessionDetailsFromQRCode(qrCode: String, resultHandler: ResultHandler<SigningSessionDetails, SigningSessionException>)
Get signing session details from MIRACL platform based on session identifier.
getUser
fun getUser(userId: String): User?
Get a registered user.
register
@JvmOverloads
fun register(userId: String, activationToken: String, pinProvider: PinProvider, pushNotificationsToken: String? = null, resultHandler: ResultHandler<User, RegistrationException>)
Provides end-user registration. Registers an end-user for a given MIRACLTrust Project to the MIRACLTrust platform.
sendVerificationEmail
fun sendVerificationEmail(userId: String, resultHandler: ResultHandler<VerificationResponse, VerificationException>)
fun sendVerificationEmail(userId: String, authenticationSessionDetails: AuthenticationSessionDetails, resultHandler: ResultHandler<VerificationResponse, VerificationException>)
Default method to verify user identity against the MIRACL platform. In the current implementation it is done by sending an email message.
sign
fun sign(message: ByteArray, timestamp: Date, user: User, pinProvider: PinProvider, resultHandler: ResultHandler<Signature, SigningException>)
Create a cryptographic signature of the given document.
signingRegister
fun signingRegister(user: User, authenticationPinProvider: PinProvider, signingPinProvider: PinProvider, resultHandler: ResultHandler<User, SigningRegistrationException>)
Creates new signing identity in the MIRACL platform.
updateProjectSettings
fun updateProjectSettings(projectId: String, clientId: String, redirectUri: String)
Set SDK project settings when they need to be updated after new session is established.