diff --git a/miracl-sdk/src/main/java/com/miracl/trust/MIRACLResult.kt b/miracl-sdk/src/main/java/com/miracl/trust/MIRACLResult.kt index 227d160..587e30f 100644 --- a/miracl-sdk/src/main/java/com/miracl/trust/MIRACLResult.kt +++ b/miracl-sdk/src/main/java/com/miracl/trust/MIRACLResult.kt @@ -1,18 +1,18 @@ package com.miracl.trust /** - * MIRACLResult is a class representing the MIRACLTrust SDK responses. + * MIRACLResult is a class representing the MIRACL Trust SDK responses. */ public sealed class MIRACLResult /** - * MIRACLSuccess is a success response from the MIRACLTrust SDK. + * MIRACLSuccess is a success response from the MIRACL Trust SDK. * It provides a value of type SUCCESS. */ public data class MIRACLSuccess(val value: SUCCESS) : MIRACLResult() /** - * MIRACLError is an error response from the MIRACLTrust SDK. + * MIRACLError is an error response from the MIRACL Trust SDK. * It provides a value of type FAIL and an optional exception. */ public data class MIRACLError(val value: FAIL) : MIRACLResult() diff --git a/miracl-sdk/src/main/java/com/miracl/trust/MIRACLTrust.kt b/miracl-sdk/src/main/java/com/miracl/trust/MIRACLTrust.kt index 6e8e366..6193623 100644 --- a/miracl-sdk/src/main/java/com/miracl/trust/MIRACLTrust.kt +++ b/miracl-sdk/src/main/java/com/miracl/trust/MIRACLTrust.kt @@ -31,10 +31,10 @@ import kotlin.coroutines.CoroutineContext import kotlin.jvm.Throws /** - * MIRACL Trust is the entry point of the MIRACL Trust SDK. It is configured and connects - * with the MIRACL Trust Platform on its initialization. + * The entry point of the MIRACL Trust SDK. It is configured + * and establishes a connection with the MIRACL Trust platform during initialisation. * - * Initialization is done through [configure(context,configuration)][configure]. After initialization, + * This is done through [configure(context,configuration)][configure]. Once initialised, * the SDK can be accessed through [getInstance()][getInstance]. */ public class MIRACLTrust private constructor( @@ -58,12 +58,12 @@ public class MIRACLTrust private constructor( } /** - * Initialize the MIRACLTrust SDK. + * Initialise the MIRACL Trust SDK. * - * > **To be used once**. Multiple uses could lead to unidentified behavior! + * > **To be used once**. Multiple uses could lead to unidentified behaviour! * - * @param context application context, used for managing storage. - * @param configuration instance of [Configuration], used to configure the SDK. + * @param context The application context, used for managing storage. + * @param configuration The instance of the [Configuration], used to configure the SDK. */ @JvmStatic public fun configure(context: Context, configuration: Configuration) { @@ -89,7 +89,7 @@ public class MIRACLTrust private constructor( private val deviceName: String = configuration.deviceName - /** Project ID setting for the application in MIRACL Trust platform. */ + /** Project ID setting for the application in the MIRACL Trust platform. */ public var projectId: String = configuration.projectId private set @@ -171,9 +171,9 @@ public class MIRACLTrust private constructor( //region SDK Configuration /** - * Configure a new project ID when the SDK have to work with a different project. + * Configures a new Project ID when the SDK has to work with a different project. * - * @param projectId `Project ID` setting for the MIRACL Platform that needs to be updated. + * @param projectId The `Project ID` setting for the MIRACL Trust platform that must be updated. */ @Throws(ConfigurationException::class) public fun setProjectId(projectId: String) { @@ -185,10 +185,10 @@ public class MIRACLTrust private constructor( } /** - * Configures new project settings when the SDK have to work with a different project. + * Configures new project settings when the SDK has to work with a different project. * - * @param projectId The unique identifier for your MIRACL Trust project. - * @param projectUrl MIRACL Trust Project URL that is used for communication with the MIRACL Trust API. + * @param projectId The unique identifier of the MIRACL Trust project. + * @param projectUrl The MIRACL Trust Project URL that is used for communication with the MIRACL Trust API. */ @Throws(ConfigurationException::class) public fun updateProjectSettings(projectId: String, projectUrl: String) { @@ -207,15 +207,15 @@ public class MIRACLTrust private constructor( //region Authentication Session management /** - * Get `authentication` session details for project in MIRACL platform based on authentication session identifier. + * Gets `authentication` session details for a project in the MIRACL Trust platform based on the authentication session identifier. * - * Use this method to get session details for application that tries to authenticate - * against MIRACL Platform with the usage of AppLink. + * Use this method to get session details for an application that tries to authenticate + * against the MIRACL Trust platform using an AppLink. * - * @param appLink a URI provided by the Intent. - * @param resultHandler a callback to handle the result of getting session details. - * - If successful, the result is [MIRACLSuccess] with the [AuthenticationSessionDetails]. - * - If an error occurs, the result is [MIRACLError] with exception describing issues with the + * @param appLink The URI provided by the Intent. + * @param resultHandler A callback to handle the result of retrieving session details. + * - If successful, the result is a [MIRACLSuccess] with the [AuthenticationSessionDetails]. + * - If an error occurs, the result is a [MIRACLError] with an exception describing issues with the * operation. */ public fun getAuthenticationSessionDetailsFromAppLink( @@ -239,15 +239,15 @@ public class MIRACLTrust private constructor( } /** - * Get `authentication` session details for project in MIRACL platform based on authentication session identifier. + * Gets `authentication` session details for a project in the MIRACL Trust platform based on the authentication session identifier. * - * Use this method to get session details for application that tries to authenticate - * against MIRACL Platform with the usage of QR Code. + * Use this method to get session details for an application that tries to authenticate + * against the MIRACL Trust platform using a QR Code. * - * @param qrCode a string read from the QR code. - * @param resultHandler a callback to handle the result of getting session details. - * - If successful, the result is [MIRACLSuccess] with the [AuthenticationSessionDetails]. - * - If an error occurs, the result is [MIRACLError] with exception describing issues with the + * @param qrCode A string read from the QR code. + * @param resultHandler A callback to handle the result of retrieving session details. + * - If successful, the result is a [MIRACLSuccess] with the [AuthenticationSessionDetails]. + * - If an error occurs, the result is a [MIRACLError] with an exception describing issues with the * operation. */ public fun getAuthenticationSessionDetailsFromQRCode( @@ -271,15 +271,15 @@ public class MIRACLTrust private constructor( } /** - * Get `authentication` session details for project in MIRACL platform based on authentication session identifier. + * Gets `authentication` session details for a project in the MIRACL Trust platform based on the authentication session identifier. * - * Use this method to get session details for application that tries to authenticate - * against MIRACL Platform with the usage of notification. + * Use this method to get session details for an application that tries to authenticate + * against the MIRACL Trust platform using a notification. * - * @param payload key-value data provided by the notification. - * @param resultHandler a callback to handle the result of getting session details. - * - If successful, the result is [MIRACLSuccess] with the [AuthenticationSessionDetails]. - * - If an error occurs, the result is [MIRACLError] with exception describing issues with the + * @param payload The key-value data provided by the notification. + * @param resultHandler A callback to handle the result of retrieving session details. + * - If successful, the result is a [MIRACLSuccess] with the [AuthenticationSessionDetails]. + * - If an error occurs, the result is a [MIRACLError] with an exception describing issues with the * operation. */ public fun getAuthenticationSessionDetailsFromNotificationPayload( @@ -303,12 +303,12 @@ public class MIRACLTrust private constructor( } /** - * Cancel the authentication session. + * Cancels the authentication session. * - * @param authenticationSessionDetails details for authentication session. - * @param resultHandler a callback to handle the result of session abort. - * - If successful, the result is [MIRACLSuccess]. - * - If an error occurs, the result is [MIRACLError] with exception describing issues with the + * @param authenticationSessionDetails The details for the authentication session. + * @param resultHandler A callback to handle the result of the session abort. + * - If successful, the result is a [MIRACLSuccess]. + * - If an error occurs, the result is a [MIRACLError] with an exception describing issues with the * operation. */ public fun abortAuthenticationSession( @@ -334,13 +334,13 @@ public class MIRACLTrust private constructor( //region CrossDeviceSession management /** - * Get [CrossDeviceSession] for an AppLink. + * Gets the [CrossDeviceSession] for an AppLink. * - * @param appLink a URI provided by the Intent. + * @param appLink The URI provided by the Intent. * - * @return a [MIRACLResult] representing the result of the operation: - * - If successful, returns [MIRACLSuccess] with the [CrossDeviceSession]. - * - If an error occurs, returns [MIRACLError] with a [CrossDeviceSessionException] + * @return A [MIRACLResult] representing the result of the operation: + * - If successful, returns a [MIRACLSuccess] with the [CrossDeviceSession]. + * - If an error occurs, returns a [MIRACLError] with a [CrossDeviceSessionException] * describing issues with the operation. * @suppress */ @@ -355,12 +355,12 @@ public class MIRACLTrust private constructor( } /** - * Get [CrossDeviceSession] for an AppLink. + * Gets the [CrossDeviceSession] for an AppLink. * - * @param appLink a URI provided by the Intent. - * @param resultHandler a callback to handle the result of getting details for the session. - * - If successful, the result is [MIRACLSuccess] with the [CrossDeviceSession]. - * - If an error occurs, the result is [MIRACLError] with exception describing issues with the + * @param appLink The URI provided by the Intent. + * @param resultHandler A callback to handle the result of retrieving session details. + * - If successful, the result is a [MIRACLSuccess] with the [CrossDeviceSession]. + * - If an error occurs, the result is a [MIRACLError] with an exception describing issues with the * operation. * @suppress */ @@ -385,13 +385,13 @@ public class MIRACLTrust private constructor( } /** - * Get [CrossDeviceSession] for a QR code. + * Gets the [CrossDeviceSession] for a QR code. * - * @param qrCode a string read from the QR code. + * @param qrCode A string read from the QR code. * - * @return a [MIRACLResult] representing the result of the operation: - * - If successful, returns [MIRACLSuccess] with the [CrossDeviceSession]. - * - If an error occurs, returns [MIRACLError] with a [CrossDeviceSessionException] + * @return A [MIRACLResult] representing the result of the operation: + * - If successful, returns a [MIRACLSuccess] with the [CrossDeviceSession]. + * - If an error occurs, returns a [MIRACLError] with a [CrossDeviceSessionException] * describing issues with the operation. * @suppress */ @@ -406,12 +406,12 @@ public class MIRACLTrust private constructor( } /** - * Get [CrossDeviceSession] for a QR code. + * Gets the [CrossDeviceSession] for a QR code. * - * @param qrCode a string read from the QR code. - * @param resultHandler a callback to handle the result of getting details for the session. - * - If successful, the result is [MIRACLSuccess] with the [CrossDeviceSession]. - * - If an error occurs, the result is [MIRACLError] with exception describing issues with the + * @param qrCode A string read from the QR code. + * @param resultHandler A callback to handle the result of retrieving session details. + * - If successful, the result is a [MIRACLSuccess] with the [CrossDeviceSession]. + * - If an error occurs, the result is a [MIRACLError] with an exception describing issues with the * operation. * @suppress */ @@ -436,13 +436,13 @@ public class MIRACLTrust private constructor( } /** - * Get [CrossDeviceSession] from a notification payload. + * Gets the [CrossDeviceSession] from a notification payload. * - * @param payload key-value data provided by the notification. + * @param payload The key-value data provided by the notification. * - * @return a [MIRACLResult] representing the result of the operation: - * - If successful, returns [MIRACLSuccess] with the [CrossDeviceSession]. - * - If an error occurs, returns [MIRACLError] with a [CrossDeviceSessionException] + * @return A [MIRACLResult] representing the result of the operation: + * - If successful, returns a [MIRACLSuccess] with the [CrossDeviceSession]. + * - If an error occurs, returns a [MIRACLError] with a [CrossDeviceSessionException] * describing issues with the operation. * @suppress */ @@ -457,12 +457,12 @@ public class MIRACLTrust private constructor( } /** - * Get [CrossDeviceSession] from a notification payload. + * Gets the [CrossDeviceSession] from a notification payload. * - * @param payload key-value data provided by the notification. - * @param resultHandler a callback to handle the result of getting details for the session. - * - If successful, the result is [MIRACLSuccess] with the [CrossDeviceSession]. - * - If an error occurs, the result is [MIRACLError] with exception describing issues with the + * @param payload The key-value data provided by the notification. + * @param resultHandler A callback to handle the result of retrieving session details. + * - If successful, the result is a [MIRACLSuccess] with the [CrossDeviceSession]. + * - If an error occurs, the result is a [MIRACLError] with an exception describing issues with the * operation. * @suppress */ @@ -490,11 +490,11 @@ public class MIRACLTrust private constructor( /** * Cancels an ongoing [CrossDeviceSession]. * - * @param crossDeviceSession the session to cancel. + * @param crossDeviceSession The session to cancel. * - * @return a [MIRACLResult] representing the result of the operation: - * - If successful, returns [MIRACLSuccess] with [Unit]. - * - If an error occurs, returns [MIRACLError] with a [CrossDeviceSessionException] + * @return A [MIRACLResult] representing the result of the operation: + * - If successful, returns a [MIRACLSuccess] with [Unit]. + * - If an error occurs, returns a [MIRACLError] with a [CrossDeviceSessionException] * describing issues with the operation. * @suppress */ @@ -509,12 +509,12 @@ public class MIRACLTrust private constructor( } /** - * Cancel the [CrossDeviceSession]. + * Cancels the [CrossDeviceSession]. * - * @param crossDeviceSession the session to cancel. - * @param resultHandler a callback to handle the result of session abort. - * - If successful, the result is [MIRACLSuccess]. - * - If an error occurs, the result is [MIRACLError] with exception describing issues with the + * @param crossDeviceSession The session to cancel. + * @param resultHandler A callback to handle the result of session abort. + * - If successful, the result is a [MIRACLSuccess]. + * - If an error occurs, the result is a [MIRACLError] with an exception describing issues with the * operation. * @suppress */ @@ -541,15 +541,15 @@ public class MIRACLTrust private constructor( //region Verification /** - * Default method to verify user identity against the MIRACL Trust platform. In the current - * implementation it is done by sending an email message. + * Default method for verifying user identity against the MIRACL Trust platform. In the current + * implementation, verification is done by sending an email message. * - * @param userId identifier of the user. To verify identity, this should be a valid email address. - * @param crossDeviceSession the session from which the verification is initiated. + * @param userId The identifier of the user. Must be a valid email address. + * @param crossDeviceSession The session from which the verification is initiated. * - * @return a [MIRACLResult] representing the result of the verification: - * - If successful, returns [MIRACLSuccess] with the [VerificationResponse]. - * - If an error occurs, returns [MIRACLError] with a [VerificationException] + * @return A [MIRACLResult] representing the result of the verification: + * - If successful, returns a [MIRACLSuccess] with the [VerificationResponse]. + * - If an error occurs, returns a [MIRACLError] with a [VerificationException] * describing issues with the operation. */ @JvmSynthetic @@ -569,14 +569,13 @@ public class MIRACLTrust private constructor( } /** - * Default method to verify user identity against the MIRACL platform. In the current - * implementation it is done by sending an email message. - * - * @param userId identifier of the user identity. To verify identity this identifier - * needs to be valid email address. - * @param resultHandler a callback to handle the result of the verification. - * - If successful, the result is [MIRACLSuccess] with the [VerificationResponse]. - * - If an error occurs, the result is [MIRACLError] with exception describing issues with the + * Default method for verifying user identity against the MIRACL Trust platform. In the current + * implementation, verification is done by sending an email message. + * + * @param userId The identifier of the user. Must be a valid email address. + * @param resultHandler A callback to handle the result of the verification. + * - If successful, the result is a [MIRACLSuccess] with the [VerificationResponse]. + * - If an error occurs, the result is a [MIRACLError] with an exception describing issues with the * operation. */ public fun sendVerificationEmail( @@ -604,15 +603,14 @@ public class MIRACLTrust private constructor( } /** - * Default method to verify user identity against the MIRACL platform. In the current - * implementation it is done by sending an email message. - * - * @param userId identifier of the user identity. To verify identity this identifier - * needs to be valid email address. - * @param authenticationSessionDetails details for authentication session. - * @param resultHandler a callback to handle the result of the verification. - * - If successful, the result is [MIRACLSuccess] with the [VerificationResponse]. - * - If an error occurs, the result is [MIRACLError] with exception describing issues with the + * Default method for verifying user identity against the MIRACL Trust platform. In the current + * implementation, verification is done by sending an email message. + * + * @param userId The identifier of the user. Must be a valid email address. + * @param authenticationSessionDetails The details for the authentication session. + * @param resultHandler A callback to handle the result of the verification. + * - If successful, the result is a [MIRACLSuccess] with the [VerificationResponse]. + * - If an error occurs, the result is a [MIRACLError] with an exception describing issues with the * operation. */ public fun sendVerificationEmail( @@ -642,15 +640,14 @@ public class MIRACLTrust private constructor( } /** - * Default method to verify user identity against the MIRACL Trust platform. In the current - * implementation it is done by sending an email message. - * - * @param userId identifier of the user identity. To verify identity this identifier - * needs to be valid email address. - * @param crossDeviceSession the session from which the verification is started. - * @param resultHandler a callback to handle the result of the verification. - * - If successful, the result is [MIRACLSuccess] with the [VerificationResponse]. - * - If an error occurs, the result is [MIRACLError] with exception describing issues with the + * Default method for verifying the user identity against the MIRACL Trust platform. In the current + * implementation, verification is done by sending an email message. + * + * @param userId The identifier of the user. Must be a valid email address. + * @param crossDeviceSession The session initiating the verification. + * @param resultHandler A callback to handle the result of the verification. + * - If successful, the result is a [MIRACLSuccess] with the [VerificationResponse]. + * - If an error occurs, the result is a [MIRACLError] with an exception describing issues with the * operation. * @suppress */ @@ -684,12 +681,12 @@ public class MIRACLTrust private constructor( * Generates a [QuickCode](https://miracl.com/resources/docs/guides/built-in-user-verification/quickcode/) * for a registered user. * - * @param user the user to generate the [QuickCode] for. - * @param pinProvider a callback called from the SDK, when the user PIN is required. + * @param user The user for whom the [QuickCode] is generated. + * @param pinProvider A callback called by the SDK when the PIN is requested. * - * @return a [MIRACLResult] representing the result of the `QuickCode` generation: - * - If successful, returns [MIRACLSuccess] with the generated [QuickCode]. - * - If an error occurs, returns [MIRACLError] with a [QuickCodeException] + * @return A [MIRACLResult] representing the result of the `QuickCode` generation: + * - If successful, returns a [MIRACLSuccess] with the generated [QuickCode]. + * - If an error occurs, returns a [MIRACLError] with a [QuickCodeException] * describing issues with the operation. */ @JvmSynthetic @@ -708,13 +705,13 @@ public class MIRACLTrust private constructor( } /** - * Generate [QuickCode](https://miracl.com/resources/docs/guides/built-in-user-verification/quickcode/) + * Generates a [QuickCode](https://miracl.com/resources/docs/guides/built-in-user-verification/quickcode/) * for a registered user. - * @param user the user to generate `QuickCode` for. - * @param pinProvider a callback called from the SDK, when the user PIN is required. - * @param resultHandler a callback to handle the result of the `QuickCode` generation. - * - If successful, the result is [MIRACLSuccess] with the [QuickCode]. - * - If an error occurs, the result is [MIRACLError] with exception describing issues with the + * @param user The user for whom the [QuickCode] is generated. + * @param pinProvider A callback called by the SDK when the PIN is requested. + * @param resultHandler A callback to handle the result of the `QuickCode` generation. + * - If successful, the result is a [MIRACLSuccess] with the [QuickCode]. + * - If an error occurs, the result is a [MIRACLError] with an exception describing issues with the * operation. */ public fun generateQuickCode( @@ -743,14 +740,14 @@ public class MIRACLTrust private constructor( } /** - * Confirms user verification and obtains an activation token that should be used + * Confirms user verification and obtains an activation token that is used * in the registration process. * - * @param verificationUri a verification URI received as part of the verification process. + * @param verificationUri The verification URI received as part of the verification process. * - * @return a [MIRACLResult] representing the result of the verification: - * - If successful, returns [MIRACLSuccess] with the [ActivationTokenResponse]. - * - If an error occurs, returns [MIRACLError] with an [ActivationTokenException] + * @return A [MIRACLResult] representing the result of the verification: + * - If successful, returns a [MIRACLSuccess] with the [ActivationTokenResponse]. + * - If an error occurs, returns a [MIRACLError] with an [ActivationTokenException] * describing issues with the operation. */ @JvmSynthetic @@ -764,12 +761,13 @@ public class MIRACLTrust private constructor( } /** - * The method confirms user verification and as a result, an activation token is obtained. This activation token should be used in the registration process. + * Confirms user verification and obtains an activation token that is used + * in the registration process. * - * @param verificationUri a verification URI received as part of the verification process. - * @param resultHandler a callback to handle the result of the verification. - * - If successful, the result is [MIRACLSuccess] with the [ActivationTokenResponse]. - * - If an error occurs, the result is [MIRACLError] with exception describing issues with the + * @param verificationUri The verification URI received as part of the verification process. + * @param resultHandler A callback to handle the result of the verification. + * - If successful, the result is a [MIRACLSuccess] with the [ActivationTokenResponse]. + * - If an error occurs, the result is a [MIRACLError] with an exception describing issues with the * operation. */ public fun getActivationToken( @@ -795,15 +793,15 @@ public class MIRACLTrust private constructor( } /** - * Confirms user verification and obtains an activation token that should be used + * Confirms user verification and obtains an activation token that is used * in the registration process. * - * @param userId identifier of the user. - * @param code a verification code received as part of the verification process. + * @param userId The identifier of the user. Must be a valid email address. + * @param code The verification code received as part of the verification process. * - * @return a [MIRACLResult] representing the result of the verification: - * - If successful, returns [MIRACLSuccess] with the [ActivationTokenResponse]. - * - If an error occurs, returns [MIRACLError] with an [ActivationTokenException] + * @return A [MIRACLResult] representing the result of the verification: + * - If successful, returns a [MIRACLSuccess] with the [ActivationTokenResponse]. + * - If an error occurs, returns a [MIRACLError] with an [ActivationTokenException] * describing issues with the operation. */ @JvmSynthetic @@ -818,13 +816,14 @@ public class MIRACLTrust private constructor( } /** - * The method confirms user verification and as a result, an activation token is obtained. This activation token should be used in the registration process. + * Confirms user verification and obtains an activation token that is used + * in the registration process. * - * @param userId identifier of the user. - * @param code the verification code sent to the user email. - * @param resultHandler a callback to handle the result of the verification. - * - If successful, the result is [MIRACLSuccess] with the [ActivationTokenResponse]. - * - If an error occurs, the result is [MIRACLError] with exception describing issues with the + * @param userId The identifier of the user. Must be a valid email address. + * @param code The verification code sent to the user's email address. + * @param resultHandler A callback to handle the result of the verification. + * - If successful, the result is a [MIRACLSuccess] with the [ActivationTokenResponse]. + * - If an error occurs, the result is a [MIRACLError] with an exception describing issues with the * operation. */ public fun getActivationToken( @@ -853,18 +852,18 @@ public class MIRACLTrust private constructor( //region Authentication User Registration /** - * Provides end-user registration. Registers an end-user for a given MIRACL Trust Project + * Provides end-user registration. Registers an end user for a given MIRACL Trust Project * to the MIRACL Trust platform. * - * @param userId provides a unique user id (i.e. email). - * @param activationToken provides an activation token for verification. - * @param pinProvider a callback called from the SDK, when the identity PIN is required. - * @param pushNotificationsToken current device push notifications token. This is used + * @param userId The identifier of the user. + * @param activationToken Provides an activation token for verification. + * @param pinProvider A callback called by the SDK when the PIN is requested. + * @param pushNotificationsToken The current device's push notifications token. This is used * when push notifications for authentication are enabled in the platform. * - * @return a [MIRACLResult] representing the result of the registration: - * - If successful, returns [MIRACLSuccess] with the registered [User]. - * - If an error occurs, returns [MIRACLError] with a [RegistrationException] + * @return A [MIRACLResult] representing the result of the registration: + * - If successful, returns a [MIRACLSuccess] with the registered [User]. + * - If an error occurs, returns a [MIRACLError] with a [RegistrationException] * describing issues with the operation. */ @JvmSynthetic @@ -888,17 +887,17 @@ public class MIRACLTrust private constructor( } /** - * Provides end-user registration. Registers an end-user for a given MIRACLTrust Project - * to the MIRACLTrust platform. + * Provides end-user registration. Registers an end user for a given MIRACL Trust project + * on the MIRACL Trust platform. * - * @param userId provides an unique user id (i.e. email). - * @param activationToken provides an activate token for verification. - * @param pinProvider a callback called from the SDK, when the identity PIN is required. - * @param pushNotificationsToken current device push notifications token. This is used + * @param userId The identifier of the user. + * @param activationToken Provides an activation token for verification. + * @param pinProvider A callback called by the SDK when the PIN is requested. + * @param pushNotificationsToken The current device's push notifications token. This is used * when push notifications for authentication are enabled in the platform. - * @param resultHandler a callback to handle the result of the registration. - * - If successful, the result is [MIRACLSuccess] with value of the registered user. - * - If an error occurs, the result is [MIRACLError] with exception describing issues with the + * @param resultHandler A callback to handle the result of the registration. + * - If successful, the result is a [MIRACLSuccess] with the value of the registered user. + * - If an error occurs, the result is a [MIRACLError] with an exception describing issues with the * operation. */ @JvmOverloads @@ -935,20 +934,20 @@ public class MIRACLTrust private constructor( //region Authentication /** - * Authenticates a user to the MIRACL Trust platform by generating a + * Authenticates an end user to the MIRACL Trust platform by generating a * [JWT](https://datatracker.ietf.org/doc/html/rfc7519) authentication token. * - * This method can be used to authenticate within your application. + * Use this method to authenticate within your application. * - * After the token is generated, it should be sent to the application server for + * After the token is generated, it must be sent to the application server for * [verification](https://miracl.com/resources/docs/guides/authentication/jwt-verification/). * - * @param user the user to authenticate. - * @param pinProvider a callback called from the SDK when the identity PIN is required. + * @param user The user to authenticate. + * @param pinProvider A callback called by the SDK when the PIN is requested. * - * @return a [MIRACLResult] representing the result of the authentication: - * - If successful, returns [MIRACLSuccess] with the JWT token as a [String]. - * - If an error occurs, returns [MIRACLError] with an [AuthenticationException] + * @return A [MIRACLResult] representing the result of the authentication: + * - If successful, returns a [MIRACLSuccess] with the JWT token as a [String]. + * - If an error occurs, returns a [MIRACLError] with an [AuthenticationException] * describing issues with the operation. */ @JvmSynthetic @@ -989,19 +988,19 @@ public class MIRACLTrust private constructor( } /** - * Authenticate identity to the MIRACL Trust platform by generating a + * Authenticates an end user to the MIRACL Trust platform by generating a * [JWT](https://datatracker.ietf.org/doc/html/rfc7519) authentication token. * * Use this method to authenticate within your application. * - * After the JWT authentication token is generated, it needs to be sent to the application + * After the JWT authentication token is generated, it must be sent to the application * server for [verification](https://miracl.com/resources/docs/guides/authentication/jwt-verification/). * - * @param user the user to authenticate. - * @param pinProvider a callback called from the SDK, when the identity PIN is required. - * @param resultHandler a callback to handle the result of the authentication. - * - If successful, the result is [MIRACLSuccess]. - * - If an error occurs, the result is [MIRACLError] with exception describing issues with the + * @param user The user to authenticate. + * @param pinProvider A callback called by the SDK when the PIN is requested. + * @param resultHandler A callback to handle the result of the authentication. + * - If successful, the result is a [MIRACLSuccess]. + * - If an error occurs, the result is a [MIRACLError] with an exception describing issues with the * operation. */ public fun authenticate( @@ -1046,18 +1045,17 @@ public class MIRACLTrust private constructor( } /** - * Authenticates identity in the MIRACL Trust platform. + * Authenticates an end user on the MIRACL Trust platform. * - * Use this method to authenticate another device or application with the usage of - * [CrossDeviceSession]. + * Use this method to authenticate another device or application using [CrossDeviceSession]. * - * @param user the user to authenticate. - * @param crossDeviceSession details for the authentication operation. - * @param pinProvider a callback called from the SDK when the identity PIN is required. + * @param user The user to authenticate. + * @param crossDeviceSession The details for the authentication operation. + * @param pinProvider A callback called by the SDK when the PIN is requested. * - * @return a [MIRACLResult] representing the result of the authentication: - * - If successful, returns [MIRACLSuccess] with [Unit]. - * - If an error occurs, returns [MIRACLError] with an [AuthenticationException] + * @return A [MIRACLResult] representing the result of the authentication: + * - If successful, returns a [MIRACLSuccess] with [Unit]. + * - If an error occurs, returns a [MIRACLError] with an [AuthenticationException] * describing issues with the operation. * @suppress */ @@ -1094,17 +1092,16 @@ public class MIRACLTrust private constructor( } /** - * Authenticates identity in the MIRACL Trust platform. + * Authenticates an end user on the MIRACL Trust platform. * - * Use this method to authenticate another device or application with the usage of - * [CrossDeviceSession]. + * Use this method to authenticate another device or application using [CrossDeviceSession]. * - * @param user the user to authenticate with. - * @param crossDeviceSession details for the authentication operation. - * @param pinProvider a callback called from the SDK, when the identity PIN is required. - * @param resultHandler a callback to handle the result of the authentication. - * - If successful, the result is [MIRACLSuccess]. - * - If an error occurs, the result is [MIRACLError] with exception describing issues with the + * @param user The user to authenticate with. + * @param crossDeviceSession The details for the authentication operation. + * @param pinProvider A callback called by the SDK when the PIN is requested. + * @param resultHandler A callback to handle the result of the authentication. + * - If successful, the result is a [MIRACLSuccess]. + * - If an error occurs, the result is a [MIRACLError] with an exception describing issues with the * operation. * @suppress */ @@ -1145,18 +1142,18 @@ public class MIRACLTrust private constructor( } /** - * Authenticates identity on the MIRACL Trust platform. + * Authenticates an end user on the MIRACL Trust platform. * - * Use this method to authenticate another device or application with the usage of - * AppLink created by MIRACL Trust platform. + * Use this method to authenticate another device or application using + * an AppLink created by the MIRACL Trust platform. * - * @param user the user to authenticate. - * @param appLink a URI provided by the Intent. - * @param pinProvider a callback called from the SDK when the identity PIN is required. + * @param user The user to authenticate. + * @param appLink The URI provided by the Intent. + * @param pinProvider A callback called by the SDK when the PIN is requested. * - * @return a [MIRACLResult] representing the result of the authentication: - * - If successful, returns [MIRACLSuccess] with [Unit]. - * - If an error occurs, returns [MIRACLError] with an [AuthenticationException] + * @return A [MIRACLResult] representing the result of the authentication: + * - If successful, returns a [MIRACLSuccess] with [Unit]. + * - If an error occurs, returns a [MIRACLError] with an [AuthenticationException] * describing issues with the operation. */ @JvmSynthetic @@ -1192,17 +1189,17 @@ public class MIRACLTrust private constructor( } /** - * Authenticate identity in the MIRACL platform. + * Authenticates an end user on the MIRACL Trust platform. * - * Use this method to authenticate another device or application with the usage of - * AppLink created by MIRACL platform. + * Use this method to authenticate another device or application using + * an AppLink created by the MIRACL Trust platform. * - * @param user the user to authenticate. - * @param appLink a URI provided by the Intent. - * @param pinProvider a callback called from the SDK, when the identity PIN is required. - * @param resultHandler a callback to handle the result of the authentication. - * - If successful, the result is [MIRACLSuccess]. - * - If an error occurs, the result is [MIRACLError] with exception describing issues with the + * @param user The user to authenticate. + * @param appLink The URI provided by the Intent. + * @param pinProvider A callback called by the SDK when the PIN is requested. + * @param resultHandler A callback to handle the result of the authentication. + * - If successful, the result is a [MIRACLSuccess]. + * - If an error occurs, the result is a [MIRACLError] with an exception describing issues with the * operation. */ public fun authenticateWithAppLink( @@ -1242,18 +1239,18 @@ public class MIRACLTrust private constructor( } /** - * Authenticates identity in the MIRACL Trust platform. + * Authenticates an end user on the MIRACL Trust platform. * - * Use this method to authenticate another device or application with the usage of - * QR Code presented on MIRACL Trust login page. + * Use this method to authenticate another device or application using + * a QR Code displayed on the MIRACL Trust login page. * - * @param user the user to authenticate. - * @param qrCode a string read from the QR code. - * @param pinProvider a callback called from the SDK when the identity PIN is required. + * @param user The user to authenticate. + * @param qrCode A string read from the QR code. + * @param pinProvider A callback called by the SDK when the PIN is requested. * - * @return a [MIRACLResult] representing the result of the authentication: - * - If successful, returns [MIRACLSuccess] with [Unit]. - * - If an error occurs, returns [MIRACLError] with an [AuthenticationException] + * @return A [MIRACLResult] representing the result of the authentication: + * - If successful, returns a [MIRACLSuccess] with [Unit]. + * - If an error occurs, returns a [MIRACLError] with an [AuthenticationException] * describing issues with the operation. */ @JvmSynthetic @@ -1289,17 +1286,17 @@ public class MIRACLTrust private constructor( } /** - * Authenticate identity in the MIRACL platform. + * Authenticates an end user on the MIRACL Trust platform. * - * Use this method to authenticate another device or application with the usage of - * QR Code presented on MIRACL login page. + * Use this method to authenticate another device or application using + * a QR Code displayed on the MIRACL Trust login page. * - * @param user the user to authenticate. - * @param qrCode a string read from the QR code. - * @param pinProvider a callback called from the SDK, when the identity PIN is required. - * @param resultHandler a callback to handle the result of the authentication. - * - If successful, the result is [MIRACLSuccess]. - * - If an error occurs, the result is [MIRACLError] with exception describing issues with the + * @param user The user to authenticate. + * @param qrCode A string read from the QR code. + * @param pinProvider A callback called by the SDK when the PIN is requested. + * @param resultHandler A callback to handle the result of the authentication. + * - If successful, the result is a [MIRACLSuccess]. + * - If an error occurs, the result is a [MIRACLError] with an exception describing issues with the * operation. */ public fun authenticateWithQRCode( @@ -1339,17 +1336,17 @@ public class MIRACLTrust private constructor( } /** - * Authenticates identity in the MIRACL Trust platform. + * Authenticates an end user on the MIRACL Trust platform. * - * Use this method to authenticate another device or application with the usage of - * notification sent by MIRACL Trust platform. + * Use this method to authenticate another device or application using + * a notification sent by the MIRACL Trust platform. * - * @param payload key-value data provided by the notification. - * @param pinProvider a callback called from the SDK when the identity PIN is required. + * @param payload The key-value data provided by the notification. + * @param pinProvider A callback called by the SDK when the PIN is requested. * - * @return a [MIRACLResult] representing the result of the authentication: - * - If successful, returns [MIRACLSuccess] with [Unit]. - * - If an error occurs, returns [MIRACLError] with an [AuthenticationException] + * @return A [MIRACLResult] representing the result of the authentication: + * - If successful, returns a [MIRACLSuccess] with [Unit]. + * - If an error occurs, returns a [MIRACLError] with an [AuthenticationException] * describing issues with the operation. */ @JvmSynthetic @@ -1383,16 +1380,16 @@ public class MIRACLTrust private constructor( } /** - * Authenticate identity in the MIRACL platform. + * Authenticates an end user on the MIRACL Trust platform. * - * Use this method to authenticate another device or application with the usage of - * notification sent by MIRACL platform. + * Use this method to authenticate another device or application using + * a notification sent by the MIRACL Trust platform. * - * @param payload key-value data provided by the notification. - * @param pinProvider a callback called from the SDK, when the identity PIN is required. - * @param resultHandler a callback to handle the result of the authentication. - * - If successful, the result is [MIRACLSuccess]. - * - If an error occurs, the result is [MIRACLError] with exception describing issues with the + * @param payload The key-value data provided by the notification. + * @param pinProvider A callback called by the SDK when the PIN is requested. + * @param resultHandler A callback to handle the result of the authentication. + * - If successful, the result is a [MIRACLSuccess]. + * - If an error occurs, the result is a [MIRACLError] with an exception describing issues with the * operation. */ public fun authenticateWithNotificationPayload( @@ -1434,13 +1431,13 @@ public class MIRACLTrust private constructor( /** * Creates a cryptographic signature of the given document. * - * @param message the hash of the given document. - * @param user a user to sign with. - * @param pinProvider a callback called from the SDK when the signing identity PIN is required. + * @param message The hash of the given document. + * @param user A user to sign with. + * @param pinProvider A callback called by the SDK when the PIN is requested. * - * @return a [MIRACLResult] representing the result of the signing operation: - * - If successful, returns [MIRACLSuccess] with the [SigningResult]. - * - If an error occurs, returns [MIRACLError] with a [SigningException] + * @return A [MIRACLResult] representing the result of the signing operation: + * - If successful, returns a [MIRACLSuccess] with the [SigningResult]. + * - If an error occurs, returns a [MIRACLError] with a [SigningException] * describing issues with the operation. */ @JvmSynthetic @@ -1461,13 +1458,13 @@ public class MIRACLTrust private constructor( } /** - * Create a cryptographic signature of the given document. - * @param message the hash of the given document. - * @param user a user to sign with. - * @param pinProvider a callback called from the SDK, when the signing identity PIN is required. - * @param resultHandler a callback to handle the result of the signing. - * - If successful, the result is [MIRACLSuccess]. - * - If an error occurs, the result is [MIRACLError] with exception describing issues with the + * Creates a cryptographic signature of the given document. + * @param message The hash of the given document. + * @param user A user to sign with. + * @param pinProvider A callback called by the SDK when the PIN is requested. + * @param resultHandler A callback to handle the result of the signing. + * - If successful, the result is a [MIRACLSuccess]. + * - If an error occurs, the result is a [MIRACLError] with an exception describing issues with the * operation. */ public fun sign( @@ -1502,13 +1499,13 @@ public class MIRACLTrust private constructor( /** * Generates a signature for a hash provided by the [crossDeviceSession] and updates the session. * - * @param crossDeviceSession details for the signing operation. - * @param user a user to sign with. - * @param pinProvider a callback called from the SDK when the signing identity PIN is required. + * @param crossDeviceSession The details for the signing operation. + * @param user A user to sign with. + * @param pinProvider A callback called by the SDK when the PIN is requested. * - * @return a [MIRACLResult] representing the result of the signing operation: - * - If successful, returns [MIRACLSuccess] with [Unit]. - * - If an error occurs, returns [MIRACLError] with a [SigningException] + * @return A [MIRACLResult] representing the result of the signing operation: + * - If successful, returns a [MIRACLSuccess] with [Unit]. + * - If an error occurs, returns a [MIRACLError] with a [SigningException] * describing issues with the operation. * @suppress */ @@ -1534,12 +1531,12 @@ public class MIRACLTrust private constructor( * Generates a signature for a hash provided by the [crossDeviceSession] parameter and updates * the session. * - * @param crossDeviceSession details for the signing operation. - * @param user a user to sign with. - * @param pinProvider a callback called from the SDK, when the signing identity PIN is required. - * @param resultHandler a callback to handle the result of the signing. - * - If successful, the result is [MIRACLSuccess]. - * - If an error occurs, the result is [MIRACLError] with exception describing issues with the + * @param crossDeviceSession The details for the signing operation. + * @param user A user to sign with. + * @param pinProvider A callback called by the SDK when the PIN is requested. + * @param resultHandler A callback to handle the result of the signing. + * - If successful, the result is a [MIRACLSuccess]. + * - If an error occurs, the result is a [MIRACLError] with an exception describing issues with the * operation. * @suppress */ @@ -1575,8 +1572,8 @@ public class MIRACLTrust private constructor( //region Users /** - * Get the registered users. - * @return a list of users. + * Gets the registered users. + * @return A list of users. */ public suspend fun getUsers(): List { return withContext(Dispatchers.IO) { @@ -1589,10 +1586,10 @@ public class MIRACLTrust private constructor( } /** - * Get the registered users. - * @param resultHandler a callback to handle the result of the user retrieval. - * - If successful, the result is [MIRACLSuccess] with a list of users. - * - If an error occurs, the result is [MIRACLError] with a [UserStorageException]. + * Gets the registered users. + * @param resultHandler A callback to handle the result of the user retrieval. + * - If successful, the result is a [MIRACLSuccess] with a list of users. + * - If an error occurs, the result is a [MIRACLError] with a [UserStorageException]. */ public fun getUsers(resultHandler: ResultHandler, UserStorageException>) { miraclTrustScope.launch { @@ -1611,10 +1608,10 @@ public class MIRACLTrust private constructor( } /** - * Get a registered user. - * @param userId Identifier of the user. - * @return the user or null if there isn't registered user for the project with - * this userId on the device. + * Gets a registered user. + * @param userId The identifier of the user. + * @return The user or null if there is no registered user with + * this userId for the project on the device. */ public suspend fun getUser(userId: String): User? { return withContext(Dispatchers.IO) { @@ -1627,12 +1624,12 @@ public class MIRACLTrust private constructor( } /** - * Get a registered user. - * @param userId Identifier of the user. - * @param resultHandler a callback to handle the result of the user retrieval. - * - If successful, the result is [MIRACLSuccess] with value of the user or null if - * there isn't registered user for the project with this userId on the device. - * - If an error occurs, the result is [MIRACLError] with a [UserStorageException]. + * Gets a registered user. + * @param userId The identifier of the user. + * @param resultHandler A callback to handle the result of the user retrieval. + * - If successful, the result is a [MIRACLSuccess] with the value of the user or null if + * there is no registered user with this userId for the project on the device. + * - If an error occurs, the result is a [MIRACLError] with a [UserStorageException]. */ public fun getUser(userId: String, resultHandler: ResultHandler) { miraclTrustScope.launch { @@ -1651,8 +1648,8 @@ public class MIRACLTrust private constructor( } /** - * Delete a registered user. - * @param user the user to be deleted. + * Deletes a registered user. + * @param user The user to be deleted. */ public suspend fun delete(user: User) { withContext(Dispatchers.IO) { @@ -1665,11 +1662,11 @@ public class MIRACLTrust private constructor( } /** - * Delete a registered user. - * @param user the user to be deleted. - * @param resultHandler a callback to handle the result of the user removal. - * - If successful, the result is [MIRACLSuccess]. - * - If an error occurs, the result is [MIRACLError] with a [UserStorageException]. + * Deletes a registered user. + * @param user The user to be deleted. + * @param resultHandler A callback to handle the result of the user removal. + * - If successful, the result is a [MIRACLSuccess]. + * - If an error occurs, the result is a [MIRACLError] with a [UserStorageException]. */ public fun delete(user: User, resultHandler: ResultHandler) { miraclTrustScope.launch { diff --git a/miracl-sdk/src/main/java/com/miracl/trust/authentication/AuthenticationException.kt b/miracl-sdk/src/main/java/com/miracl/trust/authentication/AuthenticationException.kt index 42a0f20..3afe985 100644 --- a/miracl-sdk/src/main/java/com/miracl/trust/authentication/AuthenticationException.kt +++ b/miracl-sdk/src/main/java/com/miracl/trust/authentication/AuthenticationException.kt @@ -2,25 +2,25 @@ package com.miracl.trust.authentication /** A class hierarchy that describes authentication issues. */ public sealed class AuthenticationException(cause: Throwable? = null) : Exception(cause) { - /** User object passed for authentication is not valid. */ + /** The user object passed for authentication is not valid. */ public object InvalidUserData : AuthenticationException() - /** Could not find the session identifier in App Link. */ + /** Could not find the session identifier in the App Link. */ public object InvalidAppLink : AuthenticationException() - /** Could not find the session identifier in QR URL. */ + /** Could not find the session identifier in the QR code URL. */ public object InvalidQRCode : AuthenticationException() /** Could not find a valid projectID, qrURL, or userID in the push notification payload. */ public object InvalidPushNotificationPayload : AuthenticationException() - /** There isn't a registered user for the provided user ID and project in the push notification payload. */ + /** There is no registered user for the provided User ID and project in the push notification payload. */ public object UserNotFound : AuthenticationException() - /** Pin code includes invalid symbols or pin length does not match. */ + /** PIN code contains invalid symbols or PIN length does not match. */ public object InvalidPin : AuthenticationException() - /** Pin not entered. */ + /** PIN not entered. */ public object PinCancelled : AuthenticationException() /** Invalid or expired authentication session. */ @@ -29,11 +29,11 @@ public sealed class AuthenticationException(cause: Throwable? = null) : Exceptio /** Invalid or expired cross-device session. */ public object InvalidCrossDeviceSession : AuthenticationException() - /** The authentication was not successful. */ + /** Authentication was not successful. */ public object UnsuccessfulAuthentication : AuthenticationException() - /** The user is revoked because of too many unsuccessful authentication attempts or has not been - * used in a substantial amount of time. The device needs to be re-registered. + /** The user was revoked due to too many failed authentication attempts or prolonged + * inactivity. The device must be re-registered. */ public object Revoked : AuthenticationException() diff --git a/miracl-sdk/src/main/java/com/miracl/trust/configuration/Configuration.kt b/miracl-sdk/src/main/java/com/miracl/trust/configuration/Configuration.kt index c16f408..c67d23f 100644 --- a/miracl-sdk/src/main/java/com/miracl/trust/configuration/Configuration.kt +++ b/miracl-sdk/src/main/java/com/miracl/trust/configuration/Configuration.kt @@ -13,10 +13,10 @@ import kotlin.coroutines.CoroutineContext import kotlin.jvm.Throws /** - * The Configuration class is used to set up the MIRACLTrust SDK. It provides a way + * The Configuration class is used to set up the MIRACL Trust SDK. It provides a way * to customize some of the SDK components. * - * Instance is created though its [Builder] + * Instance is created through its [Builder]. */ public class Configuration private constructor( internal val projectId: String, @@ -73,7 +73,7 @@ public class Configuration private constructor( * Builds a [Configuration] object. * * @param projectId The unique identifier for your MIRACL Trust project. - * @param projectUrl MIRACL Trust Project URL that is used for communication with the MIRACL Trust API. + * @param projectUrl The MIRACL Trust Project URL that is used for communication with the MIRACL Trust API. */ public class Builder @JvmOverloads constructor( internal val projectId: String, @@ -107,31 +107,31 @@ public class Configuration private constructor( apply { this.coroutineContext = coroutineContext } /** - * Sets additional information that will be sent via X-MIRACL-CLIENT HTTP header. + * Sets additional information that will be sent via the X-MIRACL-CLIENT HTTP header. */ public fun applicationInfo(applicationInfo: String): Builder = apply { this.applicationInfo = applicationInfo } /** - * Sets value of device name. + * Sets the value of the device name. */ public fun deviceName(deviceName: String): Builder = apply { this.deviceNameValue = deviceName } /** - * Provides implementation of the [HttpRequestExecutor] interface to be used by the SDK. + * Provides the implementation of the [HttpRequestExecutor] interface to be used by the SDK. */ public fun httpRequestExecutor(httpRequestExecutor: HttpRequestExecutor): Builder = apply { this.httpRequestExecutorValue = httpRequestExecutor } /** - * Provides implementation of the [UserStorage] interface to be used by the SDK. + * Provides the implementation of the [UserStorage] interface to be used by the SDK. */ public fun userStorage(userStorage: UserStorage): Builder = apply { this.userStorage = userStorage } /** - * Provides implementation of the [Logger] interface to be used by the SDK. + * Provides the implementation of the [Logger] interface to be used by the SDK. */ public fun logger(logger: Logger): Builder = apply { this.loggerValue = logger } @@ -139,32 +139,32 @@ public class Configuration private constructor( /** * Provides specific [Logger.LoggingLevel] to be used by the SDK default logger. * - * The default is [Logger.LoggingLevel.NONE] + * The default is [Logger.LoggingLevel.NONE]. * > * **Has no effect if using custom logger provided by - * [logger(logger: Logger)][logger]** + * [logger(logger: Logger)][logger].** */ public fun loggingLevel(loggingLevel: Logger.LoggingLevel): Builder = apply { this.loggingLevel = loggingLevel } /** - * Sets HTTP requests connect timeout in seconds to be used by the SDK default [HttpRequestExecutor]. + * Sets the HTTP requests connect timeout in seconds to be used by the SDK default [HttpRequestExecutor]. * * The default is 10 seconds. * > - * **Has no effect if using custom HTTP request executor provided by - * [httpRequestExecutor(httpRequestExecutor: HttpRequestExecutor)][httpRequestExecutor]** + * **Has no effect if using the custom HTTP request executor provided by + * [httpRequestExecutor(httpRequestExecutor: HttpRequestExecutor)][httpRequestExecutor].** */ public fun connectTimeout(connectTimeout: Int): Builder = apply { this.connectTimeout = connectTimeout } /** - * Sets HTTP requests read timeout in seconds to be used by the SDK default [HttpRequestExecutor]. + * Sets the HTTP requests read timeout in seconds to be used by the SDK default [HttpRequestExecutor]. * * The default is 10 seconds. * > - * **Has no effect if using custom HTTP request executor provided by - * [httpRequestExecutor(httpRequestExecutor: HttpRequestExecutor)][httpRequestExecutor]** + * **Has no effect if using the custom HTTP request executor provided by + * [httpRequestExecutor(httpRequestExecutor: HttpRequestExecutor)][httpRequestExecutor].** */ public fun readTimeout(readTimeout: Int): Builder = apply { this.readTimeout = readTimeout } @@ -198,4 +198,4 @@ public class Configuration private constructor( return Configuration(this) } } -} \ No newline at end of file +} diff --git a/miracl-sdk/src/main/java/com/miracl/trust/configuration/ConfigurationException.kt b/miracl-sdk/src/main/java/com/miracl/trust/configuration/ConfigurationException.kt index be5b2f2..1afda94 100644 --- a/miracl-sdk/src/main/java/com/miracl/trust/configuration/ConfigurationException.kt +++ b/miracl-sdk/src/main/java/com/miracl/trust/configuration/ConfigurationException.kt @@ -3,7 +3,7 @@ package com.miracl.trust.configuration /** A class hierarchy that describes issues with the SDK configuration. */ public sealed class ConfigurationException : Exception() { - /** Empty project ID. */ + /** Empty Project ID. */ public object EmptyProjectId : ConfigurationException() /** Invalid Project URL. */ diff --git a/miracl-sdk/src/main/java/com/miracl/trust/delegate/PinConsumer.java b/miracl-sdk/src/main/java/com/miracl/trust/delegate/PinConsumer.java index cd28555..5f7cc44 100644 --- a/miracl-sdk/src/main/java/com/miracl/trust/delegate/PinConsumer.java +++ b/miracl-sdk/src/main/java/com/miracl/trust/delegate/PinConsumer.java @@ -3,7 +3,7 @@ import androidx.annotation.Nullable; /** - * An interface used to allow the application, using the MIRACLTrust SDK, to pass the PIN + * An interface used to allow the application, using the MIRACL Trust SDK, to pass the PIN * to the SDK. */ public interface PinConsumer { diff --git a/miracl-sdk/src/main/java/com/miracl/trust/delegate/PinProvider.java b/miracl-sdk/src/main/java/com/miracl/trust/delegate/PinProvider.java index c617704..944e9e9 100644 --- a/miracl-sdk/src/main/java/com/miracl/trust/delegate/PinProvider.java +++ b/miracl-sdk/src/main/java/com/miracl/trust/delegate/PinProvider.java @@ -3,8 +3,8 @@ import androidx.annotation.NonNull; /** - * An interface used to allow the MIRACLTrust SDK to request PIN. The application using - * the SDK is responsible for obtaining the PIN from the user and then pass it + * An interface used to allow the MIRACL Trust SDK to request PIN. The application using + * the SDK is responsible for obtaining the PIN from the user and then passing it * to the {@link PinConsumer}. */ public interface PinProvider { diff --git a/miracl-sdk/src/main/java/com/miracl/trust/delegate/ResultHandler.java b/miracl-sdk/src/main/java/com/miracl/trust/delegate/ResultHandler.java index 4f262a2..6958cbe 100644 --- a/miracl-sdk/src/main/java/com/miracl/trust/delegate/ResultHandler.java +++ b/miracl-sdk/src/main/java/com/miracl/trust/delegate/ResultHandler.java @@ -7,17 +7,17 @@ import com.miracl.trust.MIRACLError; /** - * An interface used to connect MIRACLTrust SDK output to your application. + * An interface used to connect the MIRACL Trust SDK output to your application. * - *

This interface defines the {@link #onResult(MIRACLResult)} method, which handles the result of a MIRACLTrust SDK operation. + *

This interface defines the {@link #onResult(MIRACLResult)} method which handles the result of a MIRACL Trust SDK operation. * Important: Implementations of this method will be invoked on the main thread.

* - * @param type of the value on success. - * @param type of the value on failure. + * @param The value type on success. + * @param The value type on failure. */ public interface ResultHandler { /** - * Handles the result of a MIRACLTrust SDK operation. + * Handles the result of a MIRACL Trust SDK operation. * *

Important: The implementation of this method will be invoked on the main thread.

* @@ -25,4 +25,4 @@ public interface ResultHandler { * It can be either a {@link MIRACLSuccess} or a {@link MIRACLError}. */ void onResult(@NonNull MIRACLResult result); -} \ No newline at end of file +} diff --git a/miracl-sdk/src/main/java/com/miracl/trust/model/QuickCode.kt b/miracl-sdk/src/main/java/com/miracl/trust/model/QuickCode.kt index a5df8c3..6af43dc 100644 --- a/miracl-sdk/src/main/java/com/miracl/trust/model/QuickCode.kt +++ b/miracl-sdk/src/main/java/com/miracl/trust/model/QuickCode.kt @@ -5,7 +5,7 @@ import java.io.Serializable /** * Object representing QuickCode and its validity period. * @property code The issued QuickCode. - * @property expireTime MIRACL MFA system time when the code will expire. + * @property expireTime The MIRACL Trust system time when the code will expire. * @property ttlSeconds The expiration period in seconds. */ public class QuickCode internal constructor( @@ -16,4 +16,4 @@ public class QuickCode internal constructor( override fun toString(): String { return "QuickCode(code=, expireTime=$expireTime, ttlSeconds=$ttlSeconds" } -} \ No newline at end of file +} diff --git a/miracl-sdk/src/main/java/com/miracl/trust/model/User.kt b/miracl-sdk/src/main/java/com/miracl/trust/model/User.kt index 35266bb..cf0bb87 100644 --- a/miracl-sdk/src/main/java/com/miracl/trust/model/User.kt +++ b/miracl-sdk/src/main/java/com/miracl/trust/model/User.kt @@ -5,10 +5,10 @@ import com.miracl.trust.util.toSHA256 /** * Object representing the user in the platform. - * @property userId Identifier of the user. Could be email, username, etc. - * @property projectId Required to link the user with the project on the MIRACLTrust platform. - * @property revoked Provides information if the user is revoked or not. - * @property pinLength The number of the digits the user PIN should be. + * @property userId The identifier of the user. + * @property projectId Required to link the user with the project on the MIRACL Trust platform. + * @property revoked Provides information about whether the user is revoked or not. + * @property pinLength The number of digits in the user's PIN. */ @Keep public class User internal constructor( @@ -49,4 +49,4 @@ internal fun User.revoke(): User = User( token = token, dtas = dtas, publicKey = publicKey -) \ No newline at end of file +) diff --git a/miracl-sdk/src/main/java/com/miracl/trust/network/ApiException.kt b/miracl-sdk/src/main/java/com/miracl/trust/network/ApiException.kt index 5932525..9464baa 100644 --- a/miracl-sdk/src/main/java/com/miracl/trust/network/ApiException.kt +++ b/miracl-sdk/src/main/java/com/miracl/trust/network/ApiException.kt @@ -4,7 +4,7 @@ package com.miracl.trust.network public sealed class ApiException(public val url: String, cause: Throwable? = null) : Exception(cause) { - /** Error while executing HTTP request. */ + /** Error while executing the HTTP request. */ public class ExecutionError internal constructor(url: String = "", cause: Throwable? = null) : ApiException(url, cause) diff --git a/miracl-sdk/src/main/java/com/miracl/trust/network/ApiRequest.kt b/miracl-sdk/src/main/java/com/miracl/trust/network/ApiRequest.kt index a8ef6cd..644eaf9 100644 --- a/miracl-sdk/src/main/java/com/miracl/trust/network/ApiRequest.kt +++ b/miracl-sdk/src/main/java/com/miracl/trust/network/ApiRequest.kt @@ -1,7 +1,7 @@ package com.miracl.trust.network /*** - * HttpMethod is a MIRACLTrust SDK representation of the HTTP methods + * HttpMethod is a MIRACL Trust SDK representation of the HTTP methods. */ public enum class HttpMethod(public val method: String) { GET("GET"), @@ -11,7 +11,7 @@ public enum class HttpMethod(public val method: String) { } /*** - * ApiRequest is a data class that keeps the main properties of a HTTP request. + * ApiRequest is a data class that keeps the main properties of an HTTP request. */ public data class ApiRequest( val method: HttpMethod, diff --git a/miracl-sdk/src/main/java/com/miracl/trust/network/ClientErrorData.kt b/miracl-sdk/src/main/java/com/miracl/trust/network/ClientErrorData.kt index a1901e3..c009c19 100644 --- a/miracl-sdk/src/main/java/com/miracl/trust/network/ClientErrorData.kt +++ b/miracl-sdk/src/main/java/com/miracl/trust/network/ClientErrorData.kt @@ -1,10 +1,10 @@ package com.miracl.trust.network /** - * Client error representation which is returned by the MIRACL API. + * Client error representation which is returned by the MIRACL Trust API. * - * @property code Code of the error. - * @property info Human readable representation of the error. + * @property code The code of the error. + * @property info The human-readable representation of the error. * @property context Additional information received in the error response. */ public class ClientErrorData internal constructor( diff --git a/miracl-sdk/src/main/java/com/miracl/trust/network/HttpRequestExecutor.kt b/miracl-sdk/src/main/java/com/miracl/trust/network/HttpRequestExecutor.kt index e787c6b..7cf2958 100644 --- a/miracl-sdk/src/main/java/com/miracl/trust/network/HttpRequestExecutor.kt +++ b/miracl-sdk/src/main/java/com/miracl/trust/network/HttpRequestExecutor.kt @@ -1,20 +1,22 @@ package com.miracl.trust.network +import com.miracl.trust.MIRACLError import com.miracl.trust.MIRACLResult +import com.miracl.trust.MIRACLSuccess /** - * HttpRequestExecutor is an interface providing pluggable networking layer - * of the MIRACLTrust SDK. If implemented and passed as an argument when initializing the - * MIRACLTrust SDK, you can provide your own HTTP request executor. + * HttpRequestExecutor is an interface providing a pluggable networking layer + * of the MIRACL Trust SDK. If implemented and passed as an argument when initializing the + * MIRACL Trust SDK, you can provide your own HTTP request executor. */ public interface HttpRequestExecutor { /** * Executes HTTP requests. - * @param apiRequest provides the required information for processing the HTTP request. + * @param apiRequest Provides the required information for processing the HTTP request. * @return MIRACLResult which can be either: - * - MIRACLSuccess with value of type [String] (the response of the executed request) - * - MIRACLError with value of type [HttpRequestExecutorException]. + * - [MIRACLSuccess] with a value of type [String] (the response of the executed request). + * - [MIRACLError] with a value of type [HttpRequestExecutorException]. */ public suspend fun execute(apiRequest: ApiRequest): MIRACLResult } diff --git a/miracl-sdk/src/main/java/com/miracl/trust/network/HttpRequestExecutorException.kt b/miracl-sdk/src/main/java/com/miracl/trust/network/HttpRequestExecutorException.kt index ed8e32a..0006af9 100644 --- a/miracl-sdk/src/main/java/com/miracl/trust/network/HttpRequestExecutorException.kt +++ b/miracl-sdk/src/main/java/com/miracl/trust/network/HttpRequestExecutorException.kt @@ -10,7 +10,7 @@ public sealed class HttpRequestExecutorException( public class HttpError(public val responseCode: Int, public val responseBody: String) : HttpRequestExecutorException() - /** Error while executing HTTP request. */ + /** Error while executing the HTTP request. */ public class ExecutionError(message: String? = null, cause: Throwable? = null) : HttpRequestExecutorException(message = message, cause = cause) diff --git a/miracl-sdk/src/main/java/com/miracl/trust/network/HttpsURLConnectionRequestExecutor.kt b/miracl-sdk/src/main/java/com/miracl/trust/network/HttpsURLConnectionRequestExecutor.kt index 1adf3ab..6d48eac 100644 --- a/miracl-sdk/src/main/java/com/miracl/trust/network/HttpsURLConnectionRequestExecutor.kt +++ b/miracl-sdk/src/main/java/com/miracl/trust/network/HttpsURLConnectionRequestExecutor.kt @@ -3,6 +3,7 @@ package com.miracl.trust.network import com.miracl.trust.MIRACLError import com.miracl.trust.MIRACLResult import com.miracl.trust.MIRACLSuccess +import com.miracl.trust.MIRACLTrust import com.miracl.trust.util.log.Loggable import com.miracl.trust.util.log.LoggerConstants import com.miracl.trust.util.log.LoggerConstants.NETWORK_TAG @@ -42,12 +43,12 @@ internal class HttpsURLConnectionRequestExecutor( /** * Implementation of the [HttpRequestExecutor.execute]. - * @param apiRequest is a MIRACLTrust class that provides the needed data for - * a http request to be executed. + * @param apiRequest А [MIRACLTrust] class that provides the needed data for + * an HTTP request to be executed. * @return MIRACLResult - * - If the result is success execute returns MIRACLSuccess with a string value of the + * - If successful, the execute returns a [MIRACLSuccess] with a string value of the * received response. - * - If the result is error execute returns the error with a message. + * - If an error occurs, the execute returns a [MIRACLError] with a message. * If an exception is thrown, the error passes the exception as an object. */ override suspend fun execute(apiRequest: ApiRequest): MIRACLResult { @@ -165,4 +166,4 @@ internal class HttpsURLConnectionRequestExecutor( require(millis <= Int.MAX_VALUE) { "timeout too large." } return millis.toInt() } -} \ No newline at end of file +} diff --git a/miracl-sdk/src/main/java/com/miracl/trust/registration/ActivationTokenErrorResponse.kt b/miracl-sdk/src/main/java/com/miracl/trust/registration/ActivationTokenErrorResponse.kt index 8bfeb7d..a574532 100644 --- a/miracl-sdk/src/main/java/com/miracl/trust/registration/ActivationTokenErrorResponse.kt +++ b/miracl-sdk/src/main/java/com/miracl/trust/registration/ActivationTokenErrorResponse.kt @@ -4,10 +4,10 @@ import androidx.annotation.Keep import com.miracl.trust.MIRACLTrust /** - * The response returned from [getActivationToken][MIRACLTrust.getActivationToken] method when there is an error in the request. - * @property projectId Identifier of the project against which the verification is performed. - * @property userId Identifier of the user for which the verification is performed. - * @property accessId Identifier of the session from which the verification started. + * The response returned from the [getActivationToken][MIRACLTrust.getActivationToken] method when there is an error in the request. + * @property projectId The identifier of the project against which the verification is performed. + * @property userId The identifier of the user for which the verification is performed. + * @property accessId The identifier of the session from which the verification started. */ @Keep public class ActivationTokenErrorResponse internal constructor( diff --git a/miracl-sdk/src/main/java/com/miracl/trust/registration/ActivationTokenException.kt b/miracl-sdk/src/main/java/com/miracl/trust/registration/ActivationTokenException.kt index c7be40e..132f910 100644 --- a/miracl-sdk/src/main/java/com/miracl/trust/registration/ActivationTokenException.kt +++ b/miracl-sdk/src/main/java/com/miracl/trust/registration/ActivationTokenException.kt @@ -2,7 +2,7 @@ package com.miracl.trust.registration /** A class hierarchy that describes verification confirmation issues. */ public sealed class ActivationTokenException(cause: Throwable? = null) : Exception(cause) { - /** Empty user ID in the App Link. */ + /** Empty User ID in the App Link. */ public object EmptyUserId : ActivationTokenException() /** Empty verification code in the App Link. */ diff --git a/miracl-sdk/src/main/java/com/miracl/trust/registration/ActivationTokenResponse.kt b/miracl-sdk/src/main/java/com/miracl/trust/registration/ActivationTokenResponse.kt index 8631211..3ffd709 100644 --- a/miracl-sdk/src/main/java/com/miracl/trust/registration/ActivationTokenResponse.kt +++ b/miracl-sdk/src/main/java/com/miracl/trust/registration/ActivationTokenResponse.kt @@ -4,10 +4,10 @@ import androidx.annotation.Keep import com.miracl.trust.MIRACLTrust /** - * Response returned from [getActivationToken][MIRACLTrust.getActivationToken] method of [MIRACLTrust] - * @property projectId Identifier of the project against which the verification is performed. - * @property accessId Identifier of the session from which the verification started. - * @property userId Identifier of the user that is currently verified. + * Response returned from the [getActivationToken][MIRACLTrust.getActivationToken] method of [MIRACLTrust]. + * @property projectId The identifier of the project against which the verification is performed. + * @property accessId The identifier of the session from which the verification started. + * @property userId The identifier of the user that is currently being verified. * @property activationToken The activation token returned after successful user verification. */ @Keep diff --git a/miracl-sdk/src/main/java/com/miracl/trust/registration/EmailVerificationMethod.kt b/miracl-sdk/src/main/java/com/miracl/trust/registration/EmailVerificationMethod.kt index 6f41efd..6e7b72c 100644 --- a/miracl-sdk/src/main/java/com/miracl/trust/registration/EmailVerificationMethod.kt +++ b/miracl-sdk/src/main/java/com/miracl/trust/registration/EmailVerificationMethod.kt @@ -2,10 +2,10 @@ package com.miracl.trust.registration /** Possible email verification methods. */ public enum class EmailVerificationMethod { - /** Verification link is sent to the user email. */ + /** Verification link is sent to the user's email. */ Link, - /** Verification code is sent to the user email. */ + /** Verification code is sent to the user's email. */ Code; override fun toString(): String { @@ -24,4 +24,4 @@ public enum class EmailVerificationMethod { } } } -} \ No newline at end of file +} diff --git a/miracl-sdk/src/main/java/com/miracl/trust/registration/QuickCodeException.kt b/miracl-sdk/src/main/java/com/miracl/trust/registration/QuickCodeException.kt index 25a6a4c..d1fd48d 100644 --- a/miracl-sdk/src/main/java/com/miracl/trust/registration/QuickCodeException.kt +++ b/miracl-sdk/src/main/java/com/miracl/trust/registration/QuickCodeException.kt @@ -1,21 +1,21 @@ package com.miracl.trust.registration public sealed class QuickCodeException(cause: Throwable? = null) : Exception(cause) { - /** Pin code includes invalid symbols or pin length does not match. */ + /** PIN code contains invalid symbols or PIN length does not match. */ public object InvalidPin : QuickCodeException() - /** Pin not entered. */ + /** PIN not entered. */ public object PinCancelled : QuickCodeException() /** The authentication was not successful. */ public object UnsuccessfulAuthentication : QuickCodeException() - /** The user is revoked because of too many unsuccessful authentication attempts or has not been - * used in a substantial amount of time. The device needs to be re-registered. + /** The user was revoked due to too many failed authentication attempts or + prolonged inactivity. The device must be re-registered. */ public object Revoked : QuickCodeException() /** QuickCode generation failed. */ public class GenerationFail internal constructor(cause: Throwable? = null) : QuickCodeException(cause) -} \ No newline at end of file +} diff --git a/miracl-sdk/src/main/java/com/miracl/trust/registration/RegistrationException.kt b/miracl-sdk/src/main/java/com/miracl/trust/registration/RegistrationException.kt index c1b6801..6e51e37 100644 --- a/miracl-sdk/src/main/java/com/miracl/trust/registration/RegistrationException.kt +++ b/miracl-sdk/src/main/java/com/miracl/trust/registration/RegistrationException.kt @@ -2,7 +2,7 @@ package com.miracl.trust.registration /** A class hierarchy that describes registration issues. */ public sealed class RegistrationException(cause: Throwable? = null) : Exception(cause) { - /** Empty user ID. */ + /** Empty User ID. */ public object EmptyUserId : RegistrationException() /** Empty activation token. */ @@ -14,13 +14,13 @@ public sealed class RegistrationException(cause: Throwable? = null) : Exception( /** Invalid activation token. */ public object InvalidActivationToken : RegistrationException() - /** Pin code includes invalid symbols or pin length does not match. */ + /** PIN code contains invalid symbols or PIN length does not match. */ public object InvalidPin : RegistrationException() - /** Pin not entered. */ + /** PIN not entered. */ public object PinCancelled : RegistrationException() - /** Curve returned by the platform is unsupported by this version of the SDK. */ + /** The curve returned by the platform is unsupported by this version of the SDK. */ public object UnsupportedEllipticCurve : RegistrationException() /** Registration failed. */ diff --git a/miracl-sdk/src/main/java/com/miracl/trust/registration/VerificationApi.kt b/miracl-sdk/src/main/java/com/miracl/trust/registration/VerificationApi.kt index 3eef3fa..d9e66ca 100644 --- a/miracl-sdk/src/main/java/com/miracl/trust/registration/VerificationApi.kt +++ b/miracl-sdk/src/main/java/com/miracl/trust/registration/VerificationApi.kt @@ -192,4 +192,4 @@ internal class VerificationApiManager( return MIRACLError(ActivationTokenException.GetActivationTokenFail(ex)) } } -} \ No newline at end of file +} diff --git a/miracl-sdk/src/main/java/com/miracl/trust/registration/VerificationException.kt b/miracl-sdk/src/main/java/com/miracl/trust/registration/VerificationException.kt index 377586c..473adc2 100644 --- a/miracl-sdk/src/main/java/com/miracl/trust/registration/VerificationException.kt +++ b/miracl-sdk/src/main/java/com/miracl/trust/registration/VerificationException.kt @@ -2,15 +2,15 @@ package com.miracl.trust.registration /** A class hierarchy that describes verification issues. */ public sealed class VerificationException(cause: Throwable? = null) : Exception(cause) { - /** Empty user ID. */ + /** Empty User ID. */ public object EmptyUserId : VerificationException() /** The session identifier in SessionDetails is empty or blank. */ public object InvalidSessionDetails : VerificationException() /** - * Too many verification requests. Wait for the [backoff] period. - * @property backoff Unix timestamp before a new verification email could be sent for the same user ID. + * Too many verification requests. Wait until the [backoff] period has elapsed. + * @property backoff Unix timestamp after which a new verification email can be sent for the same User ID. */ public class RequestBackoff internal constructor(public val backoff: Long) : VerificationException() diff --git a/miracl-sdk/src/main/java/com/miracl/trust/registration/VerificationResponse.kt b/miracl-sdk/src/main/java/com/miracl/trust/registration/VerificationResponse.kt index 0c7c589..7c38ba9 100644 --- a/miracl-sdk/src/main/java/com/miracl/trust/registration/VerificationResponse.kt +++ b/miracl-sdk/src/main/java/com/miracl/trust/registration/VerificationResponse.kt @@ -4,8 +4,8 @@ import androidx.annotation.Keep import com.miracl.trust.MIRACLTrust /** - * Response returned from [sendVerificationEmail][MIRACLTrust.sendVerificationEmail] method of [MIRACLTrust]. - * @property backoff Unix timestamp before a new verification email could be sent for the same user ID. + * Response returned from the [sendVerificationEmail][MIRACLTrust.sendVerificationEmail] method of [MIRACLTrust]. + * @property backoff Unix timestamp after which a new verification email can be sent for the same User ID. * @property method Indicates the method of the verification. */ @Keep @@ -16,4 +16,4 @@ public class VerificationResponse internal constructor( override fun toString(): String { return "VerificationResponse(backoff=$backoff, method=$method)" } -} \ No newline at end of file +} diff --git a/miracl-sdk/src/main/java/com/miracl/trust/session/AuthenticationSessionDetails.kt b/miracl-sdk/src/main/java/com/miracl/trust/session/AuthenticationSessionDetails.kt index 31f2d5d..2b794d6 100644 --- a/miracl-sdk/src/main/java/com/miracl/trust/session/AuthenticationSessionDetails.kt +++ b/miracl-sdk/src/main/java/com/miracl/trust/session/AuthenticationSessionDetails.kt @@ -1,18 +1,18 @@ package com.miracl.trust.session /** - * Object representing details from incoming authentication session. - * @property accessId Identifier of the authentication session. - * @property userId User ID entered by the user when session is started. - * @property projectId Project ID setting for the application in MIRACL platform. - * @property projectName Name of the project in MIRACL platform. - * @property projectLogoUrl URL of the project logo. - * @property pinLength Pin Length that needs to be entered from user. - * @property verificationMethod Indicates method of user verification. - * @property verificationUrl URL for verification in case of custom verification method. - * @property verificationCustomText Custom text specified in the MIRACL Trust portal for the custom verification. - * @property identityType Identity type which will be used for identity verification. - * @property identityTypeLabel Label of the identity which will be used for identity verification. + * Object representing details from an incoming authentication session. + * @property accessId The identifier of the authentication session. + * @property userId The User ID entered by the user when the session is started. + * @property projectId The Project ID setting for the application in the MIRACL Trust platform. + * @property projectName The name of the project in the MIRACL Trust platform. + * @property projectLogoUrl The URL of the project logo. + * @property pinLength The required length of the PIN entered by the user. + * @property verificationMethod The method of user verification. + * @property verificationUrl The URL for verification when custom user verification is used. + * @property verificationCustomText The custom text specified in the MIRACL Trust Portal for the custom user verification. + * @property identityType The identity type which will be used for identity verification. + * @property identityTypeLabel The label of the identity which will be used for identity verification. * @property quickCodeEnabled Indicates whether the QuickCode is enabled for the project or not. */ public class AuthenticationSessionDetails internal constructor( diff --git a/miracl-sdk/src/main/java/com/miracl/trust/session/CrossDeviceSession.kt b/miracl-sdk/src/main/java/com/miracl/trust/session/CrossDeviceSession.kt index ff5e92f..c89a58e 100644 --- a/miracl-sdk/src/main/java/com/miracl/trust/session/CrossDeviceSession.kt +++ b/miracl-sdk/src/main/java/com/miracl/trust/session/CrossDeviceSession.kt @@ -4,11 +4,11 @@ package com.miracl.trust.session * An object representing details for an operation (authentication or signing) * started on another device. * - * @property sessionId Identifier of the session. - * @property sessionDescription Description of the operation that needs to be done. - * @property userId User ID entered by the user when session is started. - * @property projectId Project ID setting for the application in MIRACL Trust platform. - * @property signingHash Hash of the transaction that needs to be signed if any. + * @property sessionId The identifier of the session. + * @property sessionDescription The description of the operation that needs to be done. + * @property userId The User ID entered by the user when the session is started. + * @property projectId The Project ID setting for the application in the MIRACL Trust platform. + * @property signingHash The hash of the transaction that needs to be signed, if any. */ public class CrossDeviceSession( public val sessionId: String, diff --git a/miracl-sdk/src/main/java/com/miracl/trust/session/SessionDetails.kt b/miracl-sdk/src/main/java/com/miracl/trust/session/SessionDetails.kt index 678f1d6..4a097d7 100644 --- a/miracl-sdk/src/main/java/com/miracl/trust/session/SessionDetails.kt +++ b/miracl-sdk/src/main/java/com/miracl/trust/session/SessionDetails.kt @@ -1,17 +1,17 @@ package com.miracl.trust.session /** - * Object representing details from incoming session. - * @property userId User ID entered by the user when session is started. - * @property projectId Project ID setting for the application in MIRACL platform. - * @property projectName Name of the project in MIRACL platform. - * @property projectLogoUrl URL of the project logo. - * @property pinLength Pin Length that needs to be entered from user. - * @property verificationMethod Indicates method of user verification. - * @property verificationUrl URL for verification in case of custom verification method. - * @property verificationCustomText Custom text specified in the MIRACL Trust portal for the custom verification. - * @property identityType Identity type which will be used for identity verification. - * @property identityTypeLabel Label of the identity which will be used for identity verification. + * Object representing details from an incoming session. + * @property userId The User ID entered by the user when the session is started. + * @property projectId The Project ID setting for the application in the MIRACL Trust platform. + * @property projectName The name of the project in the MIRACL Trust platform. + * @property projectLogoUrl The URL of the project logo. + * @property pinLength The required length of the PIN entered by the user. + * @property verificationMethod The method of user verification. + * @property verificationUrl The URL for verification when custom user verification is used. + * @property verificationCustomText The custom text specified in the MIRACL Trust Portal for the custom user verification. + * @property identityType The identity type which will be used for identity verification. + * @property identityTypeLabel The label of the identity which will be used for identity verification. * @property quickCodeEnabled Indicates whether the QuickCode is enabled for the project or not. */ public sealed class SessionDetails( diff --git a/miracl-sdk/src/main/java/com/miracl/trust/signing/SigningException.kt b/miracl-sdk/src/main/java/com/miracl/trust/signing/SigningException.kt index 09229f2..d9fd660 100644 --- a/miracl-sdk/src/main/java/com/miracl/trust/signing/SigningException.kt +++ b/miracl-sdk/src/main/java/com/miracl/trust/signing/SigningException.kt @@ -5,24 +5,23 @@ public sealed class SigningException(cause: Throwable? = null) : Exception(cause /** Empty message hash. */ public object EmptyMessageHash : SigningException() - /** User object passed for signing is not valid. */ + /** The user object passed for signing is not valid. */ public object InvalidUserData : SigningException() - /** Pin code includes invalid symbols or pin length does not match. */ + /** PIN code contains invalid symbols or PIN length does not match. */ public object InvalidPin : SigningException() - /** Pin not entered. */ + /** PIN not entered. */ public object PinCancelled : SigningException() - /** The authentication was not successful. */ + /** Authentication was not successful. */ public object UnsuccessfulAuthentication : SigningException() - /** The user is revoked because of too many unsuccessful authentication attempts or has not been - * used in a substantial amount of time. The device needs to be re-registered. - */ + /** The user was revoked due to too many failed authentication attempts or + prolonged inactivity. The device must be re-registered.*/ public object Revoked : SigningException() - /** Public key of the signing identity is empty. */ + /** The public key of the signing identity is empty. */ public object EmptyPublicKey : SigningException() /** The session identifier in SigningSessionDetails is empty or blank. */ diff --git a/miracl-sdk/src/main/java/com/miracl/trust/signing/SigningResult.kt b/miracl-sdk/src/main/java/com/miracl/trust/signing/SigningResult.kt index 412961e..63cad44 100644 --- a/miracl-sdk/src/main/java/com/miracl/trust/signing/SigningResult.kt +++ b/miracl-sdk/src/main/java/com/miracl/trust/signing/SigningResult.kt @@ -4,9 +4,9 @@ import com.miracl.trust.MIRACLTrust import java.util.Date /** - * Result returned from [MIRACLTrust.sign] method. - * @property signature Cryptographic representation of the signature. - * @property timestamp When the document has been signed. + * Result returned from the [MIRACLTrust.sign] method. + * @property signature The cryptographic representation of the signature. + * @property timestamp Shows when the document was signed. */ public class SigningResult internal constructor( public val signature: Signature, @@ -15,4 +15,4 @@ public class SigningResult internal constructor( override fun toString(): String { return "SigningResult(signature=$signature, timestamp=$timestamp)" } -} \ No newline at end of file +} diff --git a/miracl-sdk/src/main/java/com/miracl/trust/storage/UserDto.kt b/miracl-sdk/src/main/java/com/miracl/trust/storage/UserDto.kt index 5ca7680..41bd41a 100644 --- a/miracl-sdk/src/main/java/com/miracl/trust/storage/UserDto.kt +++ b/miracl-sdk/src/main/java/com/miracl/trust/storage/UserDto.kt @@ -9,14 +9,14 @@ package com.miracl.trust.storage * Implementers must ensure secure storage (e.g., encryption at rest). * * @property userId The identifier of the user, which is unique within the scope of a project. - * Could be email, username, etc. + * Could be an email address, username, etc. * @property projectId The identifier of the project this user belongs to. * @property revoked The revocation status of the user. - * @property pinLength The user's PIN's number of digits. - * @property mpinId The identifier of this user registration in the MIRACL Trust Platform. + * @property pinLength The number of digits in the user's PIN. + * @property mpinId The identifier of this user registration in the MIRACL Trust platform. * @property publicKey The public part of the user's signing key. * @property token A secure user token. - * **CAUTION** This field contain sensitive data. The storage implementation + * **CAUTION** This field contains sensitive data. The storage implementation * is responsible for its secure handling, including encryption at rest. * @property dtas Data required for server-side validation. */ diff --git a/miracl-sdk/src/main/java/com/miracl/trust/storage/UserStorage.kt b/miracl-sdk/src/main/java/com/miracl/trust/storage/UserStorage.kt index ca2798b..6834da4 100644 --- a/miracl-sdk/src/main/java/com/miracl/trust/storage/UserStorage.kt +++ b/miracl-sdk/src/main/java/com/miracl/trust/storage/UserStorage.kt @@ -5,23 +5,22 @@ package com.miracl.trust.storage * Already registered users will be kept in it between app launches. * > * Methods of this interface must not be called outside of the SDK, as they are intended - * to be only for internal usage. + * for internal use only. * - * Keep in mind, that this interface doesn't provide any data encryption and developers should take - * care of this by themselves. + * Note that this interface does not provide any data encryption. Developers must ensure data is encrypted as needed. * > - * By default this SDK uses a concrete implementation of this interface [RoomUserStorage][com.miracl.trust.storage.room.RoomUserStorage]. + * By default, this SDK uses a concrete implementation of this interface [RoomUserStorage][com.miracl.trust.storage.room.RoomUserStorage]. */ public interface UserStorage { /** * Prepares the user storage to be used. - * > Called once on initialization of the SDK. + * > Called once when the SDK is initialized. */ public fun loadStorage() /** * Adds a registered user to the user storage. - * @param user registered user. + * @param user The registered user. */ public fun add(user: UserDto) @@ -39,8 +38,8 @@ public interface UserStorage { /** * Retrieves a registered user from the user storage. - * @param userId Identifier of the user. - * @param projectId Identifier of the project on the MIRACLTrust platform to which the user is linked. + * @param userId The identifier of the user. + * @param projectId The unique identifier of the MIRACL Trust project associated with the user. */ public fun getUser(userId: String, projectId: String): UserDto? @@ -48,4 +47,4 @@ public interface UserStorage { * Returns all users from the user storage. */ public fun all(): List -} \ No newline at end of file +} diff --git a/miracl-sdk/src/main/java/com/miracl/trust/util/log/Logger.kt b/miracl-sdk/src/main/java/com/miracl/trust/util/log/Logger.kt index e0a432f..8ef3af1 100644 --- a/miracl-sdk/src/main/java/com/miracl/trust/util/log/Logger.kt +++ b/miracl-sdk/src/main/java/com/miracl/trust/util/log/Logger.kt @@ -4,11 +4,11 @@ import com.miracl.trust.util.log.Logger.LoggingLevel import com.miracl.trust.util.log.Logger.LoggingLevel.* /** - * ## A type representing message logger - * Some important and useful information will be outputted through this interface - * while a debug build. + * ## A type representing message logger. + * Some important and useful information will be output through this interface + * during a debug build. * > - * By default this SDK uses a concrete implementation of this interface [DefaultLogger][com.miracl.trust.util.log.DefaultLogger]. + * By default, this SDK uses a concrete implementation of this interface [DefaultLogger][com.miracl.trust.util.log.DefaultLogger]. * * @see LoggingLevel */ @@ -73,4 +73,3 @@ public interface Logger { */ public fun debug(logTag: String, message: String) } -