package
0.0.0-20250205133650-a5ef9a9039e0
Repository: https://github.com/seald/go-seald-sdk.git
Documentation: pkg.go.dev

# Packages

No description provided by the author

# Functions

Initialize is the function to use to create an instance of the SDK.
NewMassReencryptOptions instantiates a MassReencryptOptions object and sets the defaults.
ParseSessionIdFromBytes takes an encrypted file as bytes, and returns the session id.
ParseSessionIdFromFile takes the path to an encrypted file, and returns the session id.
ParseSessionIdFromMessage takes an encrypted message, and returns the session id.

# Constants

0 - The session was created locally.
1 - The session was retrieved as a direct recipient.
2 - The session was retrieved as a member of a group.
3 - The session was retrieved through a proxy session.
4 - The session was retrieved through a TMR access.

# Variables

ErrorAddConnectorEmptyValue is returned when trying to add a connector with an empty string as value.
ErrorAddConnectorInvalidType is returned when a connector type is not ConnectorTypeEmail or ConnectorTypeApp.
ErrorAddConnectorInvalidValueAP is returned when a connector has a type ConnectorTypeApp, but its value does not end with "@APP_ID".
ErrorAddConnectorInvalidValueEmail is returned when a connector has a type ConnectorTypeEmail, but its value is not a valid email.
ErrorAddKeySerializer is returned when failing to create EMKs for all recipients.
ErrorAddTMRAccessCreateError is returned when failing to create a TMR access.
ErrorAddTMRAccessUnexpectedResponse is returned when an unexpected response was given by the server.
No description provided by the author
ErrorContactsContactRemoved is returned when trying to update a contact which was removed.
ErrorContactsGroupDeviceExpiresMigrationEmptyKeys is returned when trying to retrieve group keys from the server but the server unexpectedly does not return any.
ErrorContactsSigchainOutOfRange is returned when an illegal sigchain index was requested.
ErrorConvertTmrAccessCannotDecrypt is returned decryption of retrieved TMR access failed.
ErrorCreateAccountNoTeam is returned when a JWT without the join team claim is used to create an account.
ErrorCurrentDeviceSigchainNotFound is returned when the sigchain for the current device could not be found.
ErrorDatabaseAlreadyInitialized is returned when trying to initialize a database which has already been initialized.
ErrorDatabaseClosed is returned when trying to use a database which is not open.
ErrorDatabaseLocked is returned when another instance of the Seald SDK is already using this database.
ErrorDatabaseRequired is returned Database is not defined.
ErrorFailedCreated is returned when failing to create an EMK for a recipient.
ErrorGetSealdIdsFromConnectorsNoConnectors is returned when passed an empty slice of connector.
ErrorGetSealdIdsUnknownConnector is returned when one connector is unknown and don't have a corresponding sealdId.
ErrorGroupsAddMembersAdminNotMember means the admin you are trying to add is not among the members you are trying to add.
ErrorGroupsAddMembersAlreadyInGroup means the user you are trying to add is already in the group.
ErrorGroupsAddMembersRevokedUser is returned when trying to add a revoked user as group member.
ErrorGroupsCreateAdminNotMember means one of the admins of the group you are trying to create is not among the members.
ErrorGroupsCreateSelfNotAdmin means this account is not an admin of the group you are trying to create.
ErrorGroupsGroupCannotBeMember is returned when trying to set a group as a member of itself.
ErrorGroupsMemberDifferFromSigchain means the retrieved list of group members does not correspond to the retrieved Sigchain of this group.
ErrorGroupsNotAdmin means this account is not an admin of this group.
ErrorGroupsNotMember means this account is not a member of this group.
ErrorGroupsRemoveMembersNotInGroup means the user you are trying to remove is not in the group.
ErrorGroupsRenewGroupKeyCannotDecryptTMRTempKey is returned when we cannot decrypt a group TMR temporary SymKey with the group device.
ErrorGroupsRetrievedUnexpectedNumEncMK means the server responded with an unexpected number of EncryptedMessageKeys when trying to retrieve the key for this group device.
ErrorGroupsRetrieveInfoNoGroup is returned when updating a group that does not exist in the local database.
ErrorGroupsSetAdminsAddedNotMember means one of the user you are trying to add to group admins is not a group member.
ErrorGroupsSetAdminsRemovedNotMember means one of the user you are trying to remove from group admins is not a group member.
ErrorGroupsUnexpectedDeviceId means the server responded with a device ID which does not match you current device.
ErrorGroupsUnexpectedGroupMessage means the server responded with a group message, not a direct one, which is forbidden.
ErrorGroupsUserUnregistered means this account is not initialized.
ErrorInvalidAppId is returned when the AppId given in InitializeOptions is invalid.
ErrorInvalidConnectorType is returned when trying to get the indexation key of a connector with an invalid type.
ErrorInvalidDeviceId is returned when the given device id is not a valid UUIDv4.
ErrorInvalidKeySize is returned when the KeySize given in InitializeOptions is invalid.
ErrorMemberNotInGroup is returned when searching if a user is a group admin, but the user is not a group member.
ErrorNoTokenForYou is returned when trying to access a session for with the current user doesn't have a token.
ErrorPlatformRequired is returned Platform is not defined.
ErrorPreRenewalWrongCurrentKey is returned when the pre-renewal used for RenewKeys() does not include the current device private key.
ErrorPushJWTUnexpectedJoinTeam is returned when pushing JWT to join a team, account must already have one.
ErrorRequireAccount is returned when trying to use a function that needs an account, but the SDK instance has no account yet.
ErrorRequireNoAccount is returned when trying to use a function that needs an SDK without account.
ErrorRetrieveEncryptionSessionByTmrAccessCannotDecrypt is returned when decryption of all retrieved TMR access failed.
ErrorRetrieveEncryptionSessionByTmrAccessNotFound is returned when no TMR access was found.
ErrorRetrieveEncryptionSessionByTmrAccessTooManyAccesses is returned when expecting one TMR access, but multiple accesses are found.
ErrorRetrieveEncryptionSessionInvalidMessageId is returned when trying to retrieve an encryption session with an invalid message id.
ErrorRevokeUnknownDevice is returned when the specified device could not be found.
ErrorSdkClosed is returned when this SDK instance has been closed.
ErrorSessionCannotDecryptEncMK is returned when session cannot decrypt the retrieved message key.
ErrorSessionCannotDecryptEncMKWithGroup is returned when the session cannot decrypt the retrieved message key with this group.
ErrorSessionNotRetrievedUnexpectedly means that the server unexpectedly did not return one of the sessions when trying to retrieve multiple sessions.
ErrorSessionRetrievedUnexpectedNumEncMK means the server responded with an unexpected number of EncryptedMessageKeys when trying to retrieve the key for this session.
ErrorSessionUnexpectedDeviceId means the server responded with a device ID which does not match you current device.
ErrorSessionUnexpectedGroupDeviceId means the server responded with a group device ID which does not match the device ID of the group in question.
ErrorSigchainForked is returned when there is an incoherence between the sigchain known locally and the one from the server.
ErrorSigchainIntegrityDbMissingDevice is returned when the database does not know a device that is in the sigchain.
ErrorSigchainIntegrityDeviceRevoked is returned when a device is revoked in the sigchain but not the database.
ErrorSigchainIntegrityEncryptionKeyHash is returned when the EncryptionKey's hash in the database does not match the one in the sigchain.
ErrorSigchainIntegritySigchainMissingDevice is returned when the sigchain does not know a device that is in the database.
ErrorSigchainIntegritySigningKeyHash is returned when the SigningKey's hash in the database does not match the one in the sigchain.
ErrorSigchainRetrievedEmpty is returned when the retrieved sigchain has zero blocks.
ErrorSigchainUnexpectedRetrievedLastHash is returned when the retrieved sigchain differ from different API endpoint.
ErrorUnknownDevice is returned when a device with the given device id could not be found.
ErrorUnknownUserId is returned when a given recipient id is unknown.
ErrorValidateConnectorInvalidChallenge is returned when trying to validate a connector without a challenge.

# Structs

AccountInfo is returned when calling State.CreateAccount or State.GetCurrentAccountInfo, containing information about the local account.
No description provided by the author
AddKeysMultiStatusResponse represents the server response when adding session keys for multiple recipients at once.
AddKeysResponse represents the result when trying to add a session key for one recipient's device.
No description provided by the author
No description provided by the author
BeardError represents an error returned by the server.
No description provided by the author
ConnectorTypeValue is a simplified representation of a common_models.connectors for which we don't know all fields.
No description provided by the author
No description provided by the author
CreateAccountOptions is the options object for State.CreateAccount.
No description provided by the author
CreateSubIdentityOptions is the options object for State.CreateSubIdentity.
CreateSubIdentityResponse is the response object for State.CreateSubIdentity.
DeviceMissingKeys represents a device of the current account which is missing some keys, and for which you probably want to call State.MassReencrypt.
The EncryptionSession struct represents an encryption session, with which you can then encrypt / decrypt multiple messages.
EncryptionSessionRetrievalDetails represents the details of how an Encryption Session was retrieved.
FileStorage is an implementation of Database, which stores the data on the File System.
No description provided by the author
No description provided by the author
InitializeOptions is the main options object for initializing the SDK instance.
No description provided by the author
No description provided by the author
MassReencryptOptions options for MassReencrypt function.
MemoryStorage is an implementation of Database, which stores the data in memory only.
PreGeneratedKeys allows to pass pre-generated asym keys for functions that need to generated keys.
PrepareRenewOptions is the options object for PrepareRenew.
No description provided by the author
No description provided by the author
RenewKeysOptions is the options object for State.RenewKeys.
RevokeRecipientsResponse represents the server response when trying to revoke recipients from a session.
No description provided by the author
State is the object representing an instance of the Seald SDK.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Interfaces

Database is the interface that must be implemented by the storage backends.

# Type aliases

EncryptionSessionRetrievalFlow represents the way the session was retrieved : as a direct recipient, as member of a group, or through a proxy session.