# MIRACLTrust
class MIRACLTrust
MIRACL Trust is the entry point of the MIRACL Trust SDK. It is configured and connects with the MIRACL Trust 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. |
abortSigningSession | fun abortSigningSession(signingSessionDetails: SigningSessionDetails, resultHandler: ResultHandler<Unit, SigningSessionException>) Cancel the signing session. |
authenticate | fun authenticate(user: User, pinProvider: PinProvider, resultHandler: ResultHandler<String, AuthenticationException>) Authenticate identity to the MIRACL Trust platform by generating a JWT authentication token. |
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. |
delete | fun delete(user: User) Delete a registered 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>) fun getActivationToken(userId: String, code: String, 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. |
setProjectId | fun setProjectId(projectId: String) Configure a new project ID when the SDK have to work with a different project. |
sign | fun sign(message: ByteArray, timestamp: Date, user: User, pinProvider: PinProvider, resultHandler: ResultHandler<Signature, SigningException>) fun sign(message: ByteArray, timestamp: Date, user: User, signingSessionDetails: SigningSessionDetails, pinProvider: PinProvider, resultHandler: ResultHandler<Signature, SigningException>) Create a cryptographic signature of the given document. |