# Seald SDK for Android

WARNING

This package is still early-access:

  • the interface will probably still have breaking changes
  • the installation instructions may change in the future
  • some quality-of-life features are still missing
  • some bugs may still be present
  • the documentation may still be incomplete, or not very readable

Feel free to give us feedback!

This package is the Seald SDK for Android : io.seald.seald_sdk

To install it, you need two files: seald-sdk-internals-49591.aar and seald-sdk-49591.aar.

You can download these files here:

WARNING

These URLs will change for each new version published.

After that, you can place these files in your app/libs/ folder, and add the following lines to your app/build.gradle:



 
 


dependencies {
    /* ... */
    implementation files('libs/seald-sdk-internals-49539.aar')
    implementation files('libs/seald-sdk-49539.aar')
}

You can then import it in your code with:

import io.seald.seald_sdk.SealdSDK

You can also see the example app (opens new window).

This package contains the main SealdSDK class, the EncryptionSession class, as well as multiple helper classes.

# SealdSDK

SealdSDK is the main class for the Seald SDK. It represents an instance of the Seald SDK.

You can instantiate it this way:

val seald = SealdSDK(
    apiURL = "https://api.seald.io/",
    appId = "YourAppId",
    dbPath = "/myApp/seald_db",
    dbb64SymKey = "A Secret Key to encrypt the local database, encoded in b64"
)

This class then allows you to create an account, create or retrieve an EncryptionSession, etc.

See the SealdSDK reference for more information.

# EncryptionSession

An EncryptionSession allows you to encrypt / decrypt multiple messages or files.

This should not be instantiated directly, and should be either created with SealdSDK.createEncryptionSession or retrieved with SealdSDK.retrieveEncryptionSession or SealdSDK.retrieveEncryptionSessionFromMessage.

# Types

Name Summary
AccountInfo data class AccountInfo(val userId: String (opens new window), val deviceId: String (opens new window))
AccountInfo is returned when calling SealdSDK.createAccount or SealdSDK.getCurrentAccountInfo, containing information about the local account.
AddKeysMultiStatusResponse data class AddKeysMultiStatusResponse(val status: Map (opens new window)<String (opens new window), AddKeysMultiStatusResponse.AddKeysResponse>)
AddKeysMultiStatusResponse represents the server response when adding session keys for multiple recipients at once.
BeardError data class BeardError(val id: String (opens new window), val code: String (opens new window))
BeardError represents an error returned by the server. It contains a specific id and code to determine the underlying reason.
ClearFile data class ClearFile(val filename: String (opens new window), val sessionId: String (opens new window), val fileContent: ByteArray (opens new window))
ClearFile represents a decrypted file.
Connector data class Connector(val sealdId: String (opens new window), val type: ConnectorType, val value: String (opens new window), val id: String (opens new window), val state: ConnectorState)
Connector represents all details about a connector.
ConnectorState enum ConnectorState : Enum (opens new window)<ConnectorState>
ConnectorState represents the allowed values for Connector states.
ConnectorType enum ConnectorType : Enum (opens new window)<ConnectorType>
ConnectorType represents the allowed values for Connector types:
ConnectorTypeValue data class ConnectorTypeValue(val type: ConnectorType, val value: String (opens new window))
ConnectorTypeValue is a simplified representation of a connector for which we don't know all details.
CreateSubIdentityResponse data class CreateSubIdentityResponse(val deviceId: String (opens new window), val backupKey: ByteArray (opens new window))
CreateSubIdentityResponse represents a newly created sub identity.
DeviceMissingKeys data class DeviceMissingKeys(val deviceId: String (opens new window), val count: Int (opens new window))
Represents a device of the current account which is missing some keys, and for which you probably want to call SealdSDK.massReencrypt.
EncryptionSession class EncryptionSession(encryptionSession: MobileEncryptionSession)
An encryption session, with which you can then encrypt / decrypt multiple messages or files. This should not be instantiated directly, and should be either created with SealdSDK.createEncryptionSession, or retrieved with SealdSDK.retrieveEncryptionSession or SealdSDK.retrieveEncryptionSessionFromMessage.
MassReencryptOptions data class MassReencryptOptions(var retries: Int (opens new window) = 3, var retrieveBatchSize: Int (opens new window) = 1000, var waitBetweenRetries: Duration (opens new window) = Duration.ofSeconds(3), var waitProvisioning: Boolean (opens new window) = true, var waitProvisioningTime: Duration (opens new window) = Duration.ofSeconds(5), var waitProvisioningTimeMax: Duration (opens new window) = Duration.ofSeconds(10), var waitProvisioningTimeStep: Duration (opens new window) = Duration.ofSeconds(1), var waitProvisioningRetries: Int (opens new window) = 100, var forceLocalAccountUpdate: Boolean (opens new window) = false)
Options for SealdSDK.massReencrypt function.
MassReencryptResponse data class MassReencryptResponse(val reencrypted: Int (opens new window), val failed: Int (opens new window))
Represents the results of a call to SealdSDK.massReencrypt.
PreValidationToken data class PreValidationToken(val domainValidationKeyId: String (opens new window), val nonce: String (opens new window), val token: String (opens new window))
PreValidationToken represents a way for your server to authorize the adding of a connector.
RevokeRecipientsResponse data class RevokeRecipientsResponse(val userIds: Map (opens new window)<String (opens new window), String (opens new window)>, val revokeAll: RevokeRecipientsResponse.RevokeAll)
RevokeRecipientsResponse represents the server response when trying to revoke recipients from a session. It contains userIds, a map of the IDs of recipients you tried to revoke explicitly and the result for each one. It also contains revokeAll, which contains the results (in a similar format) for the recipients revoked when you try to revoke all the session's recipients.
SealdSDK class SealdSDK(apiURL: String (opens new window), appId: String (opens new window), dbPath: String (opens new window), dbb64SymKey: String (opens new window), instanceName: String (opens new window) = "SealdSDK", logLevel: Byte (opens new window) = 0, logNoColor: Boolean (opens new window) = true, encryptionSessionCacheTTL: Duration (opens new window)? = Duration.ZERO, keySize: Int (opens new window) = 4096)
This is the main class for the Seald SDK. It represents an instance of the Seald SDK.