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.
To install it, you need to add the package io.seald:seald_sdk_android
, available on Maven Central, to your dependencies.
The current version is 0.3.0-beta.0
. Here is how you can add it to your app/build.gradle
:
dependencies {
/* ... */
implementation 'io.seald:seald_sdk_android:0.3.0-beta.0'
}
dependencies {
/* ... */
implementation 'io.seald:seald_sdk_android:0.3.0-beta.0'
}
You can then import it in your code with:
import io.seald.seald_sdk.SealdSDK
import io.seald.seald_sdk.SealdSDK
You can also see the example app.
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"
)
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.
© 2023 Seald SAS
You can find the license information of Open Source libraries used in Seald SDK for mobile at https://download.seald.io/download/mobile_dependencies_licenses_0.3.0-beta.0.txt.
Types
Name | Summary |
---|---|
AccountInfo | data class AccountInfo(val userId: String, val deviceId: String, val deviceExpires: Instant?) AccountInfo is returned when calling SealdSDK.createAccount or SealdSDK.getCurrentAccountInfo, containing information about the local account. |
ActionStatus | data class ActionStatus(val success: Boolean, val errorCode: String) Represents the status of an operation on single user/device. |
AuthFactor | data class AuthFactor(val type: AuthFactorType, val value: String) Represents a user's authentication factor |
AuthFactorType | enum AuthFactorType : Enum<AuthFactorType> |
BeardError | data class BeardError(val id: String, val code: String) 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, val sessionId: String, val fileContent: ByteArray) ClearFile represents a decrypted file. |
Connector | data class Connector(val sealdId: String, val type: ConnectorType, val value: String, val id: String, val state: ConnectorState) Connector represents all details about a connector. |
ConnectorState | enum ConnectorState : Enum<ConnectorState> ConnectorState represents the allowed values for Connector states. |
ConnectorType | enum ConnectorType : Enum<ConnectorType> ConnectorType represents the allowed values for Connector types: |
ConnectorTypeValue | data class ConnectorTypeValue(val type: ConnectorType, val value: String) ConnectorTypeValue is a simplified representation of a connector for which we don't know all details. |
CreateSubIdentityResponse | data class CreateSubIdentityResponse(val deviceId: String, val backupKey: ByteArray) CreateSubIdentityResponse represents a newly created sub identity. |
DeviceMissingKeys | data class DeviceMissingKeys(val deviceId: String, val count: Int) 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@JvmOverloadsconstructor(var retries: Int = 3, var retrieveBatchSize: Int = 1000, var waitBetweenRetries: Duration = Duration.ofSeconds(3), var waitProvisioning: Boolean = true, var waitProvisioningTime: Duration = Duration.ofSeconds(5), var waitProvisioningTimeMax: Duration = Duration.ofSeconds(10), var waitProvisioningTimeStep: Duration = Duration.ofSeconds(1), var waitProvisioningRetries: Int = 100, var forceLocalAccountUpdate: Boolean = false) Options for SealdSDK.massReencrypt function. |
MassReencryptResponse | data class MassReencryptResponse(val reencrypted: Int, val failed: Int) Represents the results of a call to SealdSDK.massReencrypt. |
PreValidationToken | data class PreValidationToken(val domainValidationKeyId: String, val nonce: String, val token: String) PreValidationToken represents a way for your server to authorize the adding of a connector. |
RetrieveIdentityResponse | data class RetrieveIdentityResponse(val identity: ByteArray, val shouldRenewKey: Boolean, var authenticatedSessionId: String) RetrieveIdentityResponse holds a retrieved identity |
SealdException | class SealdException(originalException: Throwable) : RuntimeException SealdException represents an error that happened during a Seald operation. |
SealdSDK | class SealdSDK@JvmOverloadsconstructor(apiURL: String, appId: String, dbPath: String? = null, dbb64SymKey: String? = null, instanceName: String = "SealdSDK", logLevel: Byte = 0, logNoColor: Boolean = true, encryptionSessionCacheTTL: Duration? = Duration.ZERO, keySize: Int = 4096) This is the main class for the Seald SDK. It represents an instance of the Seald SDK. |
SealdSSKSPasswordPlugin | class SealdSSKSPasswordPlugin(apiURL: String, appId: String) The SealdSSKSPassword class allows to use the SSKS key storage service to store Seald identities easily and securely, encrypted by a user password. |
SealdSSKSTmrPlugin | class SealdSSKSTmrPlugin(apiURL: String, appId: String) The SealdSSKSTmrPlugin class allows to use the SSKS key storage service to store Seald identities easily and securely, encrypted by a key stored on your back-end server. |