Class SealdSDK
-
- All Implemented Interfaces:
public final class SealdSDKThis is the main class for the Seald SDK. It represents an instance of the Seald SDK.
-
-
Constructor Summary
Constructors Constructor Description SealdSDK(String apiURL, String appId, String dbPath, String dbb64SymKey, String instanceName, Byte logLevel, Boolean logNoColor, Duration encryptionSessionCacheTTL, Integer keySize)SealdSDK(String apiURL, String appId, String dbPath, String dbb64SymKey, String instanceName, Byte logLevel, Boolean logNoColor, Duration encryptionSessionCacheTTL)SealdSDK(String apiURL, String appId, String dbPath, String dbb64SymKey, String instanceName, Byte logLevel, Boolean logNoColor)SealdSDK(String apiURL, String appId, String dbPath, String dbb64SymKey, String instanceName, Byte logLevel)SealdSDK(String apiURL, String appId, String dbPath, String dbb64SymKey, String instanceName)SealdSDK(String apiURL, String appId, String dbPath, String dbb64SymKey)SealdSDK(String apiURL, String appId, String dbPath)SealdSDK(String apiURL, String appId)
-
Method Summary
Modifier and Type Method Description final Unitclose()Close the current SDK instance. final UnitcloseAsync()Close the current SDK instance. final AccountInfocreateAccount(String signupJWT, String displayName, String deviceName, Duration expireAfter)Create a new Seald SDK account for this Seald SDK instance. final AccountInfocreateAccount(String signupJWT, String displayName, String deviceName)Create a new Seald SDK account for this Seald SDK instance. final AccountInfocreateAccount(String signupJWT, String displayName)Create a new Seald SDK account for this Seald SDK instance. final AccountInfocreateAccount(String signupJWT)Create a new Seald SDK account for this Seald SDK instance. final AccountInfocreateAccountAsync(String signupJWT, String displayName, String deviceName, Duration expireAfter)Create a new Seald SDK account for this Seald SDK instance. final AccountInfocreateAccountAsync(String signupJWT, String displayName, String deviceName)Create a new Seald SDK account for this Seald SDK instance. final AccountInfocreateAccountAsync(String signupJWT, String displayName)Create a new Seald SDK account for this Seald SDK instance. final AccountInfocreateAccountAsync(String signupJWT)Create a new Seald SDK account for this Seald SDK instance. final AccountInfogetCurrentAccountInfo()Return information about the current account, or nullif there is none.final AccountInfogetCurrentAccountInfoAsync()Return information about the current account, or nullif there is none.final UnitupdateCurrentDevice()Updates the locally known information about the current device. final UnitupdateCurrentDeviceAsync()Updates the locally known information about the current device. final UnitrenewKeys(Duration expireAfter)Renew the keys of the current device, extending their validity. final UnitrenewKeys()Renew the keys of the current device, extending their validity. final UnitrenewKeysAsync(Duration expireAfter)Renew the keys of the current device, extending their validity. final UnitrenewKeysAsync()Renew the keys of the current device, extending their validity. final CreateSubIdentityResponsecreateSubIdentity(String deviceName, Duration expireAfter)Create a new sub-identity, or new device, for the current user account. final CreateSubIdentityResponsecreateSubIdentity(String deviceName)Create a new sub-identity, or new device, for the current user account. final CreateSubIdentityResponsecreateSubIdentityAsync(String deviceName, Duration expireAfter)Create a new sub-identity, or new device, for the current user account. final CreateSubIdentityResponsecreateSubIdentityAsync(String deviceName)Create a new sub-identity, or new device, for the current user account. final UnitimportIdentity(ByteArray identity)Load an identity export into the current SDK instance. final UnitimportIdentityAsync(ByteArray identity)Load an identity export into the current SDK instance. final ByteArrayexportIdentity()Export the current device as an identity export. final ByteArrayexportIdentityAsync()Export the current device as an identity export. final UnitpushJWT(String jwt)Push a given JWT to the Seald server, for example to add a connector to the current account. final UnitpushJWTAsync(String jwt)Push a given JWT to the Seald server, for example to add a connector to the current account. final Unitheartbeat()Just call the Seald server, without doing anything. final UnitheartbeatAsync()Just call the Seald server, without doing anything. final StringcreateGroup(String groupName, Array<String> members, Array<String> admins)Create a group, and returns the created group's ID. final StringcreateGroupAsync(String groupName, Array<String> members, Array<String> admins)Create a group, and returns the created group's ID. final UnitaddGroupMembers(String groupId, Array<String> membersToAdd, Array<String> adminsToSet)Add members to a group. final UnitaddGroupMembers(String groupId, Array<String> membersToAdd)Add members to a group. final UnitaddGroupMembersAsync(String groupId, Array<String> membersToAdd, Array<String> adminsToSet)Add members to a group. final UnitaddGroupMembersAsync(String groupId, Array<String> membersToAdd)Add members to a group. final UnitremoveGroupMembers(String groupId, Array<String> membersToRemove)Remove members from the group. final UnitremoveGroupMembersAsync(String groupId, Array<String> membersToRemove)Remove members from the group. final UnitrenewGroupKey(String groupId)Renew the group's private key. final UnitrenewGroupKeyAsync(String groupId)Renew the group's private key. final UnitsetGroupAdmins(String groupId, Array<String> addToAdmins, Array<String> removeFromAdmins)Add some existing group members to the group admins, and/or removes admin status from some existing group admins. final UnitsetGroupAdminsAsync(String groupId, Array<String> addToAdmins, Array<String> removeFromAdmins)Add some existing group members to the group admins, and/or removes admin status from some existing group admins. final EncryptionSessioncreateEncryptionSession(Array<String> recipients, Boolean useCache)Create an encryption session, and returns the associated EncryptionSession instance, with which you can then encrypt / decrypt multiple messages. final EncryptionSessioncreateEncryptionSession(Array<String> recipients)Create an encryption session, and returns the associated EncryptionSession instance, with which you can then encrypt / decrypt multiple messages. final EncryptionSessioncreateEncryptionSessionAsync(Array<String> recipients, Boolean useCache)Create an encryption session, and returns the associated EncryptionSession instance, with which you can then encrypt / decrypt multiple messages. final EncryptionSessioncreateEncryptionSessionAsync(Array<String> recipients)Create an encryption session, and returns the associated EncryptionSession instance, with which you can then encrypt / decrypt multiple messages. final EncryptionSessionretrieveEncryptionSession(String sessionId, Boolean useCache)Retrieve an encryption session with the sessionId, and returns the associated EncryptionSession instance, with which you can then encrypt / decrypt multiple messages. final EncryptionSessionretrieveEncryptionSession(String sessionId)Retrieve an encryption session with the sessionId, and returns the associated EncryptionSession instance, with which you can then encrypt / decrypt multiple messages. final EncryptionSessionretrieveEncryptionSessionAsync(String sessionId, Boolean useCache)Retrieve an encryption session with the sessionId, and returns the associated EncryptionSession instance, with which you can then encrypt / decrypt multiple messages. final EncryptionSessionretrieveEncryptionSessionAsync(String sessionId)Retrieve an encryption session with the sessionId, and returns the associated EncryptionSession instance, with which you can then encrypt / decrypt multiple messages. final EncryptionSessionretrieveEncryptionSessionFromMessage(String message, Boolean useCache)Retrieve an encryption session from a seald message, and returns the associated EncryptionSession instance, with which you can then encrypt / decrypt multiple messages. final EncryptionSessionretrieveEncryptionSessionFromMessage(String message)Retrieve an encryption session from a seald message, and returns the associated EncryptionSession instance, with which you can then encrypt / decrypt multiple messages. final EncryptionSessionretrieveEncryptionSessionFromMessageAsync(String message, Boolean useCache)Retrieve an encryption session from a seald message, and returns the associated EncryptionSession instance, with which you can then encrypt / decrypt multiple messages. final EncryptionSessionretrieveEncryptionSessionFromMessageAsync(String message)Retrieve an encryption session from a seald message, and returns the associated EncryptionSession instance, with which you can then encrypt / decrypt multiple messages. final EncryptionSessionretrieveEncryptionSessionFromFile(String fileUri, Boolean useCache)Retrieve an encryption session from a file URI, and returns the associated EncryptionSession instance, with which you can then encrypt / decrypt this file. final EncryptionSessionretrieveEncryptionSessionFromFile(String fileUri)Retrieve an encryption session from a file URI, and returns the associated EncryptionSession instance, with which you can then encrypt / decrypt this file. final EncryptionSessionretrieveEncryptionSessionFromFileAsync(String fileUri, Boolean useCache)Retrieve an encryption session from a file URI, and returns the associated EncryptionSession instance, with which you can then encrypt / decrypt this file. final EncryptionSessionretrieveEncryptionSessionFromFileAsync(String fileUri)Retrieve an encryption session from a file URI, and returns the associated EncryptionSession instance, with which you can then encrypt / decrypt this file. final EncryptionSessionretrieveEncryptionSessionFromBytes(ByteArray fileByteArray, Boolean useCache)Retrieve an encryption session from a ByteArray, and returns the associated EncryptionSession instance, with which you can then encrypt / decrypt this file. final EncryptionSessionretrieveEncryptionSessionFromBytes(ByteArray fileByteArray)Retrieve an encryption session from a ByteArray, and returns the associated EncryptionSession instance, with which you can then encrypt / decrypt this file. final EncryptionSessionretrieveEncryptionSessionFromBytesAsync(ByteArray fileByteArray, Boolean useCache)Retrieve an encryption session from a ByteArray, and returns the associated EncryptionSession instance, with which you can then encrypt / decrypt this file. final EncryptionSessionretrieveEncryptionSessionFromBytesAsync(ByteArray fileByteArray)Retrieve an encryption session from a ByteArray, and returns the associated EncryptionSession instance, with which you can then encrypt / decrypt this file. final Array<String>getSealdIdsFromConnectors(Array<ConnectorTypeValue> connectorTypeValues)Get all the info for the given connectors to look for, updates the local cache of connectors, and returns a slice with the corresponding SealdIds. final Array<String>getSealdIdsFromConnectorsAsync(Array<ConnectorTypeValue> connectorTypeValues)Get all the info for the given connectors to look for, updates the local cache of connectors, and returns a slice with the corresponding SealdIds. final Array<Connector>getConnectorsFromSealdId(String sealdId)List all connectors know locally for a given sealdId. final Array<Connector>getConnectorsFromSealdIdAsync(String sealdId)List all connectors know locally for a given sealdId. final ConnectoraddConnector(String value, ConnectorType connectorType, PreValidationToken preValidationToken)Add a connector to the current identity. final ConnectoraddConnector(String value, ConnectorType connectorType)Add a connector to the current identity. final ConnectoraddConnectorAsync(String value, ConnectorType connectorType, PreValidationToken preValidationToken)Add a connector to the current identity. final ConnectoraddConnectorAsync(String value, ConnectorType connectorType)Add a connector to the current identity. final ConnectorvalidateConnector(String connectorId, String challenge)Validate an added connector that was added without a preValidationToken. final ConnectorvalidateConnectorAsync(String connectorId, String challenge)Validate an added connector that was added without a preValidationToken. final ConnectorremoveConnector(String connectorId)Remove a connector belonging to the current account. final ConnectorremoveConnectorAsync(String connectorId)Remove a connector belonging to the current account. final Array<Connector>listConnectors()List connectors associated to the current account. final Array<Connector>listConnectorsAsync()List connectors associated to the current account. final ConnectorretrieveConnector(String connectorId)Retrieve a connector by its connectorId, then updates the local cache of connectors.final ConnectorretrieveConnectorAsync(String connectorId)Retrieve a connector by its connectorId, then updates the local cache of connectors.final MassReencryptResponsemassReencrypt(String deviceId, MassReencryptOptions options)Retrieve, re-encrypt, and add missing keys for a certain device. final MassReencryptResponsemassReencrypt(String deviceId)Retrieve, re-encrypt, and add missing keys for a certain device. final MassReencryptResponsemassReencryptAsync(String deviceId, MassReencryptOptions options)Retrieve, re-encrypt, and add missing keys for a certain device. final MassReencryptResponsemassReencryptAsync(String deviceId)Retrieve, re-encrypt, and add missing keys for a certain device. final Array<DeviceMissingKeys>devicesMissingKeys(Boolean forceLocalAccountUpdate)List which of the devices of the current account are missing keys, so you can call SealdSDK.massReencrypt for them. final Array<DeviceMissingKeys>devicesMissingKeys()List which of the devices of the current account are missing keys, so you can call SealdSDK.massReencrypt for them. final Array<DeviceMissingKeys>devicesMissingKeysAsync(Boolean forceLocalAccountUpdate)List which of the devices of the current account are missing keys, so you can call SealdSDK.massReencrypt for them. final Array<DeviceMissingKeys>devicesMissingKeysAsync()List which of the devices of the current account are missing keys, so you can call SealdSDK.massReencrypt for them. -
-
Constructor Detail
-
SealdSDK
SealdSDK(String apiURL, String appId, String dbPath, String dbb64SymKey, String instanceName, Byte logLevel, Boolean logNoColor, Duration encryptionSessionCacheTTL, Integer keySize)
- Parameters:
apiURL- The Seald server for this instance to use.appId- The ID given by the Seald server to your app.dbPath- The path where to store the local Seald database.dbb64SymKey- The encryption key with which to encrypt the local Seald database.instanceName- An arbitrary name to give to this Seald instance.logLevel- The minimum level of logs you want.logNoColor- Should be set tofalseif you want to enable colors in the log output.encryptionSessionCacheTTL- The duration of cache lifetime.keySize- The Asymmetric key size for newly generated keys.
-
SealdSDK
SealdSDK(String apiURL, String appId, String dbPath, String dbb64SymKey, String instanceName, Byte logLevel, Boolean logNoColor, Duration encryptionSessionCacheTTL)
- Parameters:
apiURL- The Seald server for this instance to use.appId- The ID given by the Seald server to your app.dbPath- The path where to store the local Seald database.dbb64SymKey- The encryption key with which to encrypt the local Seald database.instanceName- An arbitrary name to give to this Seald instance.logLevel- The minimum level of logs you want.logNoColor- Should be set tofalseif you want to enable colors in the log output.encryptionSessionCacheTTL- The duration of cache lifetime.
-
SealdSDK
SealdSDK(String apiURL, String appId, String dbPath, String dbb64SymKey, String instanceName, Byte logLevel, Boolean logNoColor)
- Parameters:
apiURL- The Seald server for this instance to use.appId- The ID given by the Seald server to your app.dbPath- The path where to store the local Seald database.dbb64SymKey- The encryption key with which to encrypt the local Seald database.instanceName- An arbitrary name to give to this Seald instance.logLevel- The minimum level of logs you want.logNoColor- Should be set tofalseif you want to enable colors in the log output.
-
SealdSDK
SealdSDK(String apiURL, String appId, String dbPath, String dbb64SymKey, String instanceName, Byte logLevel)
- Parameters:
apiURL- The Seald server for this instance to use.appId- The ID given by the Seald server to your app.dbPath- The path where to store the local Seald database.dbb64SymKey- The encryption key with which to encrypt the local Seald database.instanceName- An arbitrary name to give to this Seald instance.logLevel- The minimum level of logs you want.
-
SealdSDK
SealdSDK(String apiURL, String appId, String dbPath, String dbb64SymKey, String instanceName)
- Parameters:
apiURL- The Seald server for this instance to use.appId- The ID given by the Seald server to your app.dbPath- The path where to store the local Seald database.dbb64SymKey- The encryption key with which to encrypt the local Seald database.instanceName- An arbitrary name to give to this Seald instance.
-
SealdSDK
SealdSDK(String apiURL, String appId, String dbPath, String dbb64SymKey)
- Parameters:
apiURL- The Seald server for this instance to use.appId- The ID given by the Seald server to your app.dbPath- The path where to store the local Seald database.dbb64SymKey- The encryption key with which to encrypt the local Seald database.
-
SealdSDK
SealdSDK(String apiURL, String appId, String dbPath)
- Parameters:
apiURL- The Seald server for this instance to use.appId- The ID given by the Seald server to your app.dbPath- The path where to store the local Seald database.
-
-
Method Detail
-
close
final Unit close()
Close the current SDK instance. This frees any lock on the current database. After calling close, the instance cannot be used anymore.
-
closeAsync
final Unit closeAsync()
Close the current SDK instance. This frees any lock on the current database. After calling close, the instance cannot be used anymore.
-
createAccount
@JvmOverloads() final AccountInfo createAccount(String signupJWT, String displayName, String deviceName, Duration expireAfter)
Create a new Seald SDK account for this Seald SDK instance. This function can only be called if the current SDK instance does not have an account yet.
- Parameters:
signupJWT- The JWT to allow this SDK instance to create an account.displayName- An optional name for the user to create.deviceName- An optional name for the device to create.expireAfter- The duration during which the created device key will be valid without renewal.
-
createAccount
@JvmOverloads() final AccountInfo createAccount(String signupJWT, String displayName, String deviceName)
Create a new Seald SDK account for this Seald SDK instance. This function can only be called if the current SDK instance does not have an account yet.
- Parameters:
signupJWT- The JWT to allow this SDK instance to create an account.displayName- An optional name for the user to create.deviceName- An optional name for the device to create.
-
createAccount
@JvmOverloads() final AccountInfo createAccount(String signupJWT, String displayName)
Create a new Seald SDK account for this Seald SDK instance. This function can only be called if the current SDK instance does not have an account yet.
- Parameters:
signupJWT- The JWT to allow this SDK instance to create an account.displayName- An optional name for the user to create.
-
createAccount
@JvmOverloads() final AccountInfo createAccount(String signupJWT)
Create a new Seald SDK account for this Seald SDK instance. This function can only be called if the current SDK instance does not have an account yet.
- Parameters:
signupJWT- The JWT to allow this SDK instance to create an account.
-
createAccountAsync
@JvmOverloads() final AccountInfo createAccountAsync(String signupJWT, String displayName, String deviceName, Duration expireAfter)
Create a new Seald SDK account for this Seald SDK instance. This function can only be called if the current SDK instance does not have an account yet.
- Parameters:
signupJWT- The JWT to allow this SDK instance to create an account.displayName- An optional name for the user to create.deviceName- An optional name for the device to create.expireAfter- The duration during which the created device key will be valid without renewal.
-
createAccountAsync
@JvmOverloads() final AccountInfo createAccountAsync(String signupJWT, String displayName, String deviceName)
Create a new Seald SDK account for this Seald SDK instance. This function can only be called if the current SDK instance does not have an account yet.
- Parameters:
signupJWT- The JWT to allow this SDK instance to create an account.displayName- An optional name for the user to create.deviceName- An optional name for the device to create.
-
createAccountAsync
@JvmOverloads() final AccountInfo createAccountAsync(String signupJWT, String displayName)
Create a new Seald SDK account for this Seald SDK instance. This function can only be called if the current SDK instance does not have an account yet.
- Parameters:
signupJWT- The JWT to allow this SDK instance to create an account.displayName- An optional name for the user to create.
-
createAccountAsync
@JvmOverloads() final AccountInfo createAccountAsync(String signupJWT)
Create a new Seald SDK account for this Seald SDK instance. This function can only be called if the current SDK instance does not have an account yet.
- Parameters:
signupJWT- The JWT to allow this SDK instance to create an account.
-
getCurrentAccountInfo
final AccountInfo getCurrentAccountInfo()
Return information about the current account, or
nullif there is none.
-
getCurrentAccountInfoAsync
final AccountInfo getCurrentAccountInfoAsync()
Return information about the current account, or
nullif there is none.
-
updateCurrentDevice
final Unit updateCurrentDevice()
Updates the locally known information about the current device. You should never have to call this manually, except if you getting
nullin AccountInfo.deviceExpires, which can happen if migrating from an older version of the SDK, or if the internal call to updateCurrentDevice failed when calling SealdSdk.importIdentity.
-
updateCurrentDeviceAsync
final Unit updateCurrentDeviceAsync()
Updates the locally known information about the current device. You should never have to call this manually, except if you getting
nullin AccountInfo.deviceExpires, which can happen if migrating from an older version of the SDK, or if the internal call to updateCurrentDevice failed when calling SealdSdk.importIdentity.
-
renewKeys
@JvmOverloads() final Unit renewKeys(Duration expireAfter)
Renew the keys of the current device, extending their validity. If the current device has expired, you will need to call renewKeys before you are able to do anything else. Warning: if the identity of the current device is stored externally, for example on SSKS, you will want to re-export it and store it again, otherwise the previously stored identity will not be recognized anymore.
- Parameters:
expireAfter- The duration during which the renewed device key will be valid without further renewal.
-
renewKeys
@JvmOverloads() final Unit renewKeys()
Renew the keys of the current device, extending their validity. If the current device has expired, you will need to call renewKeys before you are able to do anything else. Warning: if the identity of the current device is stored externally, for example on SSKS, you will want to re-export it and store it again, otherwise the previously stored identity will not be recognized anymore.
-
renewKeysAsync
@JvmOverloads() final Unit renewKeysAsync(Duration expireAfter)
Renew the keys of the current device, extending their validity. If the current device has expired, you will need to call renewKeys before you are able to do anything else. Warning: if the identity of the current device is stored externally, for example on SSKS, you will want to re-export it and store it again, otherwise the previously stored identity will not be recognized anymore.
- Parameters:
expireAfter- The duration during which the renewed device key will be valid without further renewal.
-
renewKeysAsync
@JvmOverloads() final Unit renewKeysAsync()
Renew the keys of the current device, extending their validity. If the current device has expired, you will need to call renewKeys before you are able to do anything else. Warning: if the identity of the current device is stored externally, for example on SSKS, you will want to re-export it and store it again, otherwise the previously stored identity will not be recognized anymore.
-
createSubIdentity
@JvmOverloads() final CreateSubIdentityResponse createSubIdentity(String deviceName, Duration expireAfter)
Create a new sub-identity, or new device, for the current user account. After creating this new device, you will probably want to call SealdSDK.massReencrypt, so that the newly created device will be able to decrypt EncryptionSessions previously created for this account.
- Parameters:
deviceName- An optional name for the device to create.expireAfter- The duration during which the device key for the device to create will be valid without renewal.
-
createSubIdentity
@JvmOverloads() final CreateSubIdentityResponse createSubIdentity(String deviceName)
Create a new sub-identity, or new device, for the current user account. After creating this new device, you will probably want to call SealdSDK.massReencrypt, so that the newly created device will be able to decrypt EncryptionSessions previously created for this account.
- Parameters:
deviceName- An optional name for the device to create.
-
createSubIdentityAsync
@JvmOverloads() final CreateSubIdentityResponse createSubIdentityAsync(String deviceName, Duration expireAfter)
Create a new sub-identity, or new device, for the current user account. After creating this new device, you will probably want to call SealdSDK.massReencrypt, so that the newly created device will be able to decrypt EncryptionSessions previously created for this account.
- Parameters:
deviceName- An optional name for the device to create.expireAfter- The duration during which the device key for the device to create will be valid without renewal.
-
createSubIdentityAsync
@JvmOverloads() final CreateSubIdentityResponse createSubIdentityAsync(String deviceName)
Create a new sub-identity, or new device, for the current user account. After creating this new device, you will probably want to call SealdSDK.massReencrypt, so that the newly created device will be able to decrypt EncryptionSessions previously created for this account.
- Parameters:
deviceName- An optional name for the device to create.
-
importIdentity
final Unit importIdentity(ByteArray identity)
Load an identity export into the current SDK instance. This function can only be called if the current SDK instance does not have an account yet.
- Parameters:
identity- The identity export that this SDK instance should import.
-
importIdentityAsync
final Unit importIdentityAsync(ByteArray identity)
Load an identity export into the current SDK instance. This function can only be called if the current SDK instance does not have an account yet.
- Parameters:
identity- The identity export that this SDK instance should import.
-
exportIdentity
final ByteArray exportIdentity()
Export the current device as an identity export.
-
exportIdentityAsync
final ByteArray exportIdentityAsync()
Export the current device as an identity export.
-
pushJWT
final Unit pushJWT(String jwt)
Push a given JWT to the Seald server, for example to add a connector to the current account.
- Parameters:
jwt- The JWT to push
-
pushJWTAsync
final Unit pushJWTAsync(String jwt)
Push a given JWT to the Seald server, for example to add a connector to the current account.
- Parameters:
jwt- The JWT to push
-
heartbeat
final Unit heartbeat()
Just call the Seald server, without doing anything. This may be used for example to verify that the current instance has a valid identity.
-
heartbeatAsync
final Unit heartbeatAsync()
Just call the Seald server, without doing anything. This may be used for example to verify that the current instance has a valid identity.
-
createGroup
final String createGroup(String groupName, Array<String> members, Array<String> admins)
Create a group, and returns the created group's ID. admins must also be members. admins must include yourself.
- Parameters:
groupName- A name for the group.members- The Seald IDs of the members to add to the group.admins- The Seald IDs of the members to also add as group admins.
-
createGroupAsync
final String createGroupAsync(String groupName, Array<String> members, Array<String> admins)
Create a group, and returns the created group's ID. admins must also be members. admins must include yourself.
- Parameters:
groupName- A name for the group.members- The Seald IDs of the members to add to the group.admins- The Seald IDs of the members to also add as group admins.
-
addGroupMembers
@JvmOverloads() final Unit addGroupMembers(String groupId, Array<String> membersToAdd, Array<String> adminsToSet)
Add members to a group. Can only be done by a group administrator. Can also specify which of these newly added group members should also be admins.
- Parameters:
groupId- The group in which to add members.membersToAdd- The Seald IDs of the members to add to the group.adminsToSet- The Seald IDs of the newly added members to also set as group admins.
-
addGroupMembers
@JvmOverloads() final Unit addGroupMembers(String groupId, Array<String> membersToAdd)
Add members to a group. Can only be done by a group administrator. Can also specify which of these newly added group members should also be admins.
- Parameters:
groupId- The group in which to add members.membersToAdd- The Seald IDs of the members to add to the group.
-
addGroupMembersAsync
@JvmOverloads() final Unit addGroupMembersAsync(String groupId, Array<String> membersToAdd, Array<String> adminsToSet)
Add members to a group. Can only be done by a group administrator. Can also specify which of these newly added group members should also be admins.
- Parameters:
groupId- The group in which to add members.membersToAdd- The Seald IDs of the members to add to the group.adminsToSet- The Seald IDs of the newly added members to also set as group admins.
-
addGroupMembersAsync
@JvmOverloads() final Unit addGroupMembersAsync(String groupId, Array<String> membersToAdd)
Add members to a group. Can only be done by a group administrator. Can also specify which of these newly added group members should also be admins.
- Parameters:
groupId- The group in which to add members.membersToAdd- The Seald IDs of the members to add to the group.
-
removeGroupMembers
final Unit removeGroupMembers(String groupId, Array<String> membersToRemove)
Remove members from the group. Can only be done by a group administrator. You should call renewGroupKey after this.
- Parameters:
groupId- The group from which to remove members.membersToRemove- The Seald IDs of the members to remove from the group.
-
removeGroupMembersAsync
final Unit removeGroupMembersAsync(String groupId, Array<String> membersToRemove)
Remove members from the group. Can only be done by a group administrator. You should call renewGroupKey after this.
- Parameters:
groupId- The group from which to remove members.membersToRemove- The Seald IDs of the members to remove from the group.
-
renewGroupKey
final Unit renewGroupKey(String groupId)
Renew the group's private key. Can only be done by a group administrator. Should be called after removing members from the group.
- Parameters:
groupId- The group for which to renew the private key.
-
renewGroupKeyAsync
final Unit renewGroupKeyAsync(String groupId)
Renew the group's private key. Can only be done by a group administrator. Should be called after removing members from the group.
- Parameters:
groupId- The group for which to renew the private key.
-
setGroupAdmins
final Unit setGroupAdmins(String groupId, Array<String> addToAdmins, Array<String> removeFromAdmins)
Add some existing group members to the group admins, and/or removes admin status from some existing group admins. Can only be done by a group administrator.
- Parameters:
groupId- The group for which to set admins.addToAdmins- The Seald IDs of existing group members to add as group admins.removeFromAdmins- The Seald IDs of existing group members to remove from group admins.
-
setGroupAdminsAsync
final Unit setGroupAdminsAsync(String groupId, Array<String> addToAdmins, Array<String> removeFromAdmins)
Add some existing group members to the group admins, and/or removes admin status from some existing group admins. Can only be done by a group administrator.
- Parameters:
groupId- The group for which to set admins.addToAdmins- The Seald IDs of existing group members to add as group admins.removeFromAdmins- The Seald IDs of existing group members to remove from group admins.
-
createEncryptionSession
@JvmOverloads() final EncryptionSession createEncryptionSession(Array<String> recipients, Boolean useCache)
Create an encryption session, and returns the associated EncryptionSession instance, with which you can then encrypt / decrypt multiple messages. Warning : if you want to be able to retrieve the session later, you must put your own UserId in the recipients argument.
- Parameters:
recipients- The Seald IDs of users who should be able to retrieve this session.useCache- Whether or not to use the cache (if enabled globally).
-
createEncryptionSession
@JvmOverloads() final EncryptionSession createEncryptionSession(Array<String> recipients)
Create an encryption session, and returns the associated EncryptionSession instance, with which you can then encrypt / decrypt multiple messages. Warning : if you want to be able to retrieve the session later, you must put your own UserId in the recipients argument.
- Parameters:
recipients- The Seald IDs of users who should be able to retrieve this session.
-
createEncryptionSessionAsync
@JvmOverloads() final EncryptionSession createEncryptionSessionAsync(Array<String> recipients, Boolean useCache)
Create an encryption session, and returns the associated EncryptionSession instance, with which you can then encrypt / decrypt multiple messages. Warning : if you want to be able to retrieve the session later, you must put your own UserId in the recipients argument.
- Parameters:
recipients- The Seald IDs of users who should be able to retrieve this session.useCache- Whether or not to use the cache (if enabled globally).
-
createEncryptionSessionAsync
@JvmOverloads() final EncryptionSession createEncryptionSessionAsync(Array<String> recipients)
Create an encryption session, and returns the associated EncryptionSession instance, with which you can then encrypt / decrypt multiple messages. Warning : if you want to be able to retrieve the session later, you must put your own UserId in the recipients argument.
- Parameters:
recipients- The Seald IDs of users who should be able to retrieve this session.
-
retrieveEncryptionSession
@JvmOverloads() final EncryptionSession retrieveEncryptionSession(String sessionId, Boolean useCache)
Retrieve an encryption session with the sessionId, and returns the associated EncryptionSession instance, with which you can then encrypt / decrypt multiple messages.
- Parameters:
sessionId- The ID of the session to retrieve.useCache- Whether or not to use the cache (if enabled globally).
-
retrieveEncryptionSession
@JvmOverloads() final EncryptionSession retrieveEncryptionSession(String sessionId)
Retrieve an encryption session with the sessionId, and returns the associated EncryptionSession instance, with which you can then encrypt / decrypt multiple messages.
- Parameters:
sessionId- The ID of the session to retrieve.
-
retrieveEncryptionSessionAsync
@JvmOverloads() final EncryptionSession retrieveEncryptionSessionAsync(String sessionId, Boolean useCache)
Retrieve an encryption session with the sessionId, and returns the associated EncryptionSession instance, with which you can then encrypt / decrypt multiple messages.
- Parameters:
sessionId- The ID of the session to retrieve.useCache- Whether or not to use the cache (if enabled globally).
-
retrieveEncryptionSessionAsync
@JvmOverloads() final EncryptionSession retrieveEncryptionSessionAsync(String sessionId)
Retrieve an encryption session with the sessionId, and returns the associated EncryptionSession instance, with which you can then encrypt / decrypt multiple messages.
- Parameters:
sessionId- The ID of the session to retrieve.
-
retrieveEncryptionSessionFromMessage
@JvmOverloads() final EncryptionSession retrieveEncryptionSessionFromMessage(String message, Boolean useCache)
Retrieve an encryption session from a seald message, and returns the associated EncryptionSession instance, with which you can then encrypt / decrypt multiple messages.
- Parameters:
message- Any message belonging to the session to retrieve.useCache- Whether or not to use the cache (if enabled globally).
-
retrieveEncryptionSessionFromMessage
@JvmOverloads() final EncryptionSession retrieveEncryptionSessionFromMessage(String message)
Retrieve an encryption session from a seald message, and returns the associated EncryptionSession instance, with which you can then encrypt / decrypt multiple messages.
- Parameters:
message- Any message belonging to the session to retrieve.
-
retrieveEncryptionSessionFromMessageAsync
@JvmOverloads() final EncryptionSession retrieveEncryptionSessionFromMessageAsync(String message, Boolean useCache)
Retrieve an encryption session from a seald message, and returns the associated EncryptionSession instance, with which you can then encrypt / decrypt multiple messages.
- Parameters:
message- Any message belonging to the session to retrieve.useCache- Whether or not to use the cache (if enabled globally).
-
retrieveEncryptionSessionFromMessageAsync
@JvmOverloads() final EncryptionSession retrieveEncryptionSessionFromMessageAsync(String message)
Retrieve an encryption session from a seald message, and returns the associated EncryptionSession instance, with which you can then encrypt / decrypt multiple messages.
- Parameters:
message- Any message belonging to the session to retrieve.
-
retrieveEncryptionSessionFromFile
@JvmOverloads() final EncryptionSession retrieveEncryptionSessionFromFile(String fileUri, Boolean useCache)
Retrieve an encryption session from a file URI, and returns the associated EncryptionSession instance, with which you can then encrypt / decrypt this file.
- Parameters:
fileUri- Any encrypted file belonging to the session to retrieve.useCache- Whether or not to use the cache (if enabled globally).
-
retrieveEncryptionSessionFromFile
@JvmOverloads() final EncryptionSession retrieveEncryptionSessionFromFile(String fileUri)
Retrieve an encryption session from a file URI, and returns the associated EncryptionSession instance, with which you can then encrypt / decrypt this file.
- Parameters:
fileUri- Any encrypted file belonging to the session to retrieve.
-
retrieveEncryptionSessionFromFileAsync
@JvmOverloads() final EncryptionSession retrieveEncryptionSessionFromFileAsync(String fileUri, Boolean useCache)
Retrieve an encryption session from a file URI, and returns the associated EncryptionSession instance, with which you can then encrypt / decrypt this file.
- Parameters:
fileUri- Any encrypted file belonging to the session to retrieve.useCache- Whether or not to use the cache (if enabled globally).
-
retrieveEncryptionSessionFromFileAsync
@JvmOverloads() final EncryptionSession retrieveEncryptionSessionFromFileAsync(String fileUri)
Retrieve an encryption session from a file URI, and returns the associated EncryptionSession instance, with which you can then encrypt / decrypt this file.
- Parameters:
fileUri- Any encrypted file belonging to the session to retrieve.
-
retrieveEncryptionSessionFromBytes
@JvmOverloads() final EncryptionSession retrieveEncryptionSessionFromBytes(ByteArray fileByteArray, Boolean useCache)
Retrieve an encryption session from a ByteArray, and returns the associated EncryptionSession instance, with which you can then encrypt / decrypt this file.
- Parameters:
fileByteArray- A ByteArray of an encrypted file belonging to the session to retrieve.useCache- Whether or not to use the cache (if enabled globally).
-
retrieveEncryptionSessionFromBytes
@JvmOverloads() final EncryptionSession retrieveEncryptionSessionFromBytes(ByteArray fileByteArray)
Retrieve an encryption session from a ByteArray, and returns the associated EncryptionSession instance, with which you can then encrypt / decrypt this file.
- Parameters:
fileByteArray- A ByteArray of an encrypted file belonging to the session to retrieve.
-
retrieveEncryptionSessionFromBytesAsync
@JvmOverloads() final EncryptionSession retrieveEncryptionSessionFromBytesAsync(ByteArray fileByteArray, Boolean useCache)
Retrieve an encryption session from a ByteArray, and returns the associated EncryptionSession instance, with which you can then encrypt / decrypt this file.
- Parameters:
fileByteArray- A ByteArray of an encrypted file belonging to the session to retrieve.useCache- Whether or not to use the cache (if enabled globally).
-
retrieveEncryptionSessionFromBytesAsync
@JvmOverloads() final EncryptionSession retrieveEncryptionSessionFromBytesAsync(ByteArray fileByteArray)
Retrieve an encryption session from a ByteArray, and returns the associated EncryptionSession instance, with which you can then encrypt / decrypt this file.
- Parameters:
fileByteArray- A ByteArray of an encrypted file belonging to the session to retrieve.
-
getSealdIdsFromConnectors
final Array<String> getSealdIdsFromConnectors(Array<ConnectorTypeValue> connectorTypeValues)
Get all the info for the given connectors to look for, updates the local cache of connectors, and returns a slice with the corresponding SealdIds. SealdIds are not de-duped and can appear for multiple connector values. If one of the connectors is not assigned to a Seald user, this will return a ErrorGetSealdIdsUnknownConnector error, with the details of the missing connector.
- Parameters:
connectorTypeValues- An Array of ConnectorTypeValue instances.
-
getSealdIdsFromConnectorsAsync
final Array<String> getSealdIdsFromConnectorsAsync(Array<ConnectorTypeValue> connectorTypeValues)
Get all the info for the given connectors to look for, updates the local cache of connectors, and returns a slice with the corresponding SealdIds. SealdIds are not de-duped and can appear for multiple connector values. If one of the connectors is not assigned to a Seald user, this will return a ErrorGetSealdIdsUnknownConnector error, with the details of the missing connector.
- Parameters:
connectorTypeValues- An Array of ConnectorTypeValue instances.
-
getConnectorsFromSealdId
final Array<Connector> getConnectorsFromSealdId(String sealdId)
List all connectors know locally for a given sealdId.
- Parameters:
sealdId- The Seald ID for which to list connectors
-
getConnectorsFromSealdIdAsync
final Array<Connector> getConnectorsFromSealdIdAsync(String sealdId)
List all connectors know locally for a given sealdId.
- Parameters:
sealdId- The Seald ID for which to list connectors
-
addConnector
@JvmOverloads() final Connector addConnector(String value, ConnectorType connectorType, PreValidationToken preValidationToken)
Add a connector to the current identity. If no preValidationToken is given, the connector will need to be validated before use.
- Parameters:
value- The value of the connector to add.connectorType- The type of the connector.preValidationToken- Given by your server to authorize the adding of a connector.
-
addConnector
@JvmOverloads() final Connector addConnector(String value, ConnectorType connectorType)
Add a connector to the current identity. If no preValidationToken is given, the connector will need to be validated before use.
- Parameters:
value- The value of the connector to add.connectorType- The type of the connector.
-
addConnectorAsync
@JvmOverloads() final Connector addConnectorAsync(String value, ConnectorType connectorType, PreValidationToken preValidationToken)
Add a connector to the current identity. If no preValidationToken is given, the connector will need to be validated before use.
- Parameters:
value- The value of the connector to add.connectorType- The type of the connector.preValidationToken- Given by your server to authorize the adding of a connector.
-
addConnectorAsync
@JvmOverloads() final Connector addConnectorAsync(String value, ConnectorType connectorType)
Add a connector to the current identity. If no preValidationToken is given, the connector will need to be validated before use.
- Parameters:
value- The value of the connector to add.connectorType- The type of the connector.
-
validateConnector
final Connector validateConnector(String connectorId, String challenge)
Validate an added connector that was added without a preValidationToken.
- Parameters:
connectorId- The ID of the connector to validate.challenge- The challenge.
-
validateConnectorAsync
final Connector validateConnectorAsync(String connectorId, String challenge)
Validate an added connector that was added without a preValidationToken.
- Parameters:
connectorId- The ID of the connector to validate.challenge- The challenge.
-
removeConnector
final Connector removeConnector(String connectorId)
Remove a connector belonging to the current account.
- Parameters:
connectorId- The ID of the connector to remove.
-
removeConnectorAsync
final Connector removeConnectorAsync(String connectorId)
Remove a connector belonging to the current account.
- Parameters:
connectorId- The ID of the connector to remove.
-
listConnectors
final Array<Connector> listConnectors()
List connectors associated to the current account.
-
listConnectorsAsync
final Array<Connector> listConnectorsAsync()
List connectors associated to the current account.
-
retrieveConnector
final Connector retrieveConnector(String connectorId)
Retrieve a connector by its
connectorId, then updates the local cache of connectors.- Parameters:
connectorId- The ID of the connector to retrieve.
-
retrieveConnectorAsync
final Connector retrieveConnectorAsync(String connectorId)
Retrieve a connector by its
connectorId, then updates the local cache of connectors.- Parameters:
connectorId- The ID of the connector to retrieve.
-
massReencrypt
@JvmOverloads() final MassReencryptResponse massReencrypt(String deviceId, MassReencryptOptions options)
Retrieve, re-encrypt, and add missing keys for a certain device.
- Parameters:
deviceId- The ID of the device for which to re-rencrypt.options- A MassReencryptOptions instance.
-
massReencrypt
@JvmOverloads() final MassReencryptResponse massReencrypt(String deviceId)
Retrieve, re-encrypt, and add missing keys for a certain device.
- Parameters:
deviceId- The ID of the device for which to re-rencrypt.
-
massReencryptAsync
@JvmOverloads() final MassReencryptResponse massReencryptAsync(String deviceId, MassReencryptOptions options)
Retrieve, re-encrypt, and add missing keys for a certain device.
- Parameters:
deviceId- The ID of the device for which to re-rencrypt.options- A MassReencryptOptions instance.
-
massReencryptAsync
@JvmOverloads() final MassReencryptResponse massReencryptAsync(String deviceId)
Retrieve, re-encrypt, and add missing keys for a certain device.
- Parameters:
deviceId- The ID of the device for which to re-rencrypt.
-
devicesMissingKeys
@JvmOverloads() final Array<DeviceMissingKeys> devicesMissingKeys(Boolean forceLocalAccountUpdate)
List which of the devices of the current account are missing keys, so you can call SealdSDK.massReencrypt for them.
- Parameters:
forceLocalAccountUpdate- Whether to update the local account
-
devicesMissingKeys
@JvmOverloads() final Array<DeviceMissingKeys> devicesMissingKeys()
List which of the devices of the current account are missing keys, so you can call SealdSDK.massReencrypt for them.
-
devicesMissingKeysAsync
@JvmOverloads() final Array<DeviceMissingKeys> devicesMissingKeysAsync(Boolean forceLocalAccountUpdate)
List which of the devices of the current account are missing keys, so you can call SealdSDK.massReencrypt for them.
- Parameters:
forceLocalAccountUpdate- Whether to update the local account
-
devicesMissingKeysAsync
@JvmOverloads() final Array<DeviceMissingKeys> devicesMissingKeysAsync()
List which of the devices of the current account are missing keys, so you can call SealdSDK.massReencrypt for them.
-
-
-
-