class SealdAnonymousSdk
@interface SealdAnonymousSdk : NSObject
This is the main class for the anonymous Seald SDK. It represents an instance of the Anonymous Seald SDK.
Members | Descriptions |
---|---|
initWithApiUrl:appId:instanceName:logLevel:logNoColor:error: | Initialize a Seald Anonymous SDK Instance. |
createAnonymousEncryptionSessionWithEncryptionToken:getKeysToken:recipients:tmrRecipients:error: | Create an anonymous encryption session, and returns the associated SealdAnonymousEncryptionSession instance, with which you can then encrypt / decrypt multiple messages. |
createAnonymousEncryptionSessionAsyncWithEncryptionToken:getKeysToken:recipients:tmrRecipients:completionHandler: | Create an anonymous encryption session, and returns the associated SealdAnonymousEncryptionSession instance, with which you can then encrypt / decrypt multiple messages. |
deserializeAnonymousEncryptionSession:error: | Deserialize a serialized session. For advanced use. |
initWithApiUrl:appId:instanceName:logLevel:logNoColor:error:
- (instancetype) initWithApiUrl:(const NSString *)apiUrl
appId:(const NSString *)appId
instanceName:(const NSString *)instanceName
logLevel:(const NSInteger)logLevel
logNoColor:(const BOOL)logNoColor
error:(NSError *_Nullable *)error;
Initialize a Seald Anonymous SDK Instance.
Parameters
apiUrl
The Seald server for this instance to use. This value is given on your Seald dashboard.appId
The ID given by the Seald server to your app. This value is given on your Seald dashboard.instanceName
An arbitrary name to give to this Seald instance. Can be useful for debugging when multiple instances are running in parallel, as it is added to logs.logLevel
The minimum level of logs you want. All logs of this level or above will be displayed.-1
: Trace;0
: Debug;1
: Info;2
: Warn;3
: Error;4
: Fatal;5
: Panic;6
: NoLevel;7
: Disabled.logNoColor
Should be set toNO
if you want to enable colors in the log output,YES
if you don't.error
Error pointer.
createAnonymousEncryptionSessionWithEncryptionToken:getKeysToken:recipients:tmrRecipients:error:
- (SealdAnonymousEncryptionSession *) createAnonymousEncryptionSessionWithEncryptionToken:(const NSString *)encryptionToken
getKeysToken:(const NSString *_Nullable)getKeysToken
recipients:(const NSArray< NSString * > *)recipients
tmrRecipients:(const NSArray< SealdAnonymousTmrRecipient * > *)tmrRecipients
error:(NSError *_Nullable *)error;
Create an anonymous encryption session, and returns the associated SealdAnonymousEncryptionSession instance, with which you can then encrypt / decrypt multiple messages.
Parameters
encryptionToken
Mandatory. The JWT used for EncryptionSession creation.getKeysToken
Optional. The JWT used for the key retrieval. If not supplied, the key retrieval will useencryptionToken
recipients
The Seald IDs of users who should be able to retrieve this session.tmrRecipients
Array of TMR recipients of the session to create.error
The error that occurred while creating the session, if any.
Returns
The created SealdAnonymousEncryptionSession, or null if an error occurred.
createAnonymousEncryptionSessionAsyncWithEncryptionToken:getKeysToken:recipients:tmrRecipients:completionHandler:
- (void) createAnonymousEncryptionSessionAsyncWithEncryptionToken:(const NSString *)encryptionToken
getKeysToken:(const NSString *_Nullable)getKeysToken
recipients:(const NSArray< NSString * > *)recipients
tmrRecipients:(const NSArray< SealdAnonymousTmrRecipient * > *)tmrRecipients
completionHandler:(void(^)(SealdAnonymousEncryptionSession *anonymousEncryptionSession, NSError *_Nullable error))completionHandler;
Create an anonymous encryption session, and returns the associated SealdAnonymousEncryptionSession instance, with which you can then encrypt / decrypt multiple messages.
Parameters
encryptionToken
Mandatory. The JWT used for EncryptionSession creation.getKeysToken
Optional. The JWT used for the key retrieval. If not supplied, the key retrieval will useencryptionToken
recipients
The Seald IDs of users who should be able to retrieve this session.tmrRecipients
Array of TMR recipients of the session to create.completionHandler
A callback called after function execution. This callback takes two arguments, a SealdAnonymousEncryptionSession* containing the created anonymous encryption session, and aNSError*
that indicates if any error occurred.
deserializeAnonymousEncryptionSession:error:
- (SealdAnonymousEncryptionSession *) deserializeAnonymousEncryptionSession:(const NSString *_Nonnull)serializedSession
error:(NSError *_Nullable *)error;
Deserialize a serialized session. For advanced use.
Parameters
serializedSession
The serialized encryption session to deserialize.error
The error that occurred while retrieving the session, if any.
Returns
The deserialized SealdAnonymousEncryptionSession, or null if an error occurred.