class SealdAnonymousSdk
@interface SealdAnonymousSdk : NSObjectThis is the main class for the anonymous Seald SDK. It represents an instance of the Anonymous Seald SDK.
| Members | Descriptions |
|---|---|
initWithApiUrl:appId:maxParallelRequests: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:maxParallelRequests:instanceName:logLevel:logNoColor:error:
- (instancetype) initWithApiUrl:(const NSString *)apiUrl
appId:(const NSString *)appId
maxParallelRequests:(const NSInteger)maxParallelRequests
instanceName:(const NSString *)instanceName
logLevel:(const NSInteger)logLevel
logNoColor:(const BOOL)logNoColor
error:(NSError *_Nullable *)error;Initialize a Seald Anonymous SDK Instance.
Parameters
apiUrlThe Seald server for this instance to use. This value is given on your Seald dashboard.appIdThe ID given by the Seald server to your app. This value is given on your Seald dashboard.maxParallelRequestsThe maximum number of concurrent network requests allowed for this instance. Set to 0 to use the default (10). Set to a negative value to disable the limit entirely.instanceNameAn 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.logLevelThe 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.logNoColorShould be set toNOif you want to enable colors in the log output,YESif you don't.errorError 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
encryptionTokenMandatory. The JWT used for EncryptionSession creation.getKeysTokenOptional. The JWT used for the key retrieval. If not supplied, the key retrieval will useencryptionTokenrecipientsThe Seald IDs of users who should be able to retrieve this session.tmrRecipientsArray of TMR recipients of the session to create.errorThe 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
encryptionTokenMandatory. The JWT used for EncryptionSession creation.getKeysTokenOptional. The JWT used for the key retrieval. If not supplied, the key retrieval will useencryptionTokenrecipientsThe Seald IDs of users who should be able to retrieve this session.tmrRecipientsArray of TMR recipients of the session to create.completionHandlerA 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
serializedSessionThe serialized encryption session to deserialize.errorThe error that occurred while retrieving the session, if any.
Returns
The deserialized SealdAnonymousEncryptionSession, or null if an error occurred.