class SealdSsksPasswordPlugin
@interface SealdSsksPasswordPlugin : NSObjectThis is the main class for the Seald SSKS password plugin. It represents an instance of the Plugin.
| Members | Descriptions |
|---|---|
initWithSsksURL:appId:maxParallelRequests:instanceName:logLevel:logNoColor: | Initialize an instance of Seald SSKS Password plugin. |
initWithSsksURL:appId: | |
saveIdentityWithUserId:password:identity:error: | Save the given identity for the given userId, encrypted with the given password. |
saveIdentityAsyncWithUserId:password:identity:completionHandler: | Save the given identity for the given userId, encrypted with the given password. |
saveIdentityWithUserId:rawStorageKey:rawEncryptionKey:identity:error: | Save the given identity for the given userId, encrypted with the given raw keys. |
saveIdentityAsyncWithUserId:rawStorageKey:rawEncryptionKey:identity:completionHandler: | Save the given identity for the given userId, encrypted with the given raw keys. |
retrieveIdentityWithUserId:password:error: | Retrieve the identity stored on the SSKS server for the given userId, and decrypt it with the given password. |
retrieveIdentityAsyncWithUserId:password:completionHandler: | Retrieve the identity stored on the SSKS server for the given userId, and decrypt it with the given password. |
retrieveIdentityWithUserId:rawStorageKey:rawEncryptionKey:error: | Retrieve the identity stored on the SSKS server for the given userId, and decrypt it with the given raw keys. |
retrieveIdentityAsyncWithUserId:rawStorageKey:rawEncryptionKey:completionHandler: | Retrieve the identity stored on the SSKS server for the given userId, and decrypt it with the given raw keys. |
changeIdentityPasswordWithUserId:currentPassword:newPassword:error: | Change the password used to encrypt the identity for the userId. |
changeIdentityPasswordAsyncWithUserId:currentPassword:newPassword:completionHandler: | Change the password used to encrypt the identity for the userId. |
initWithSsksURL:appId:maxParallelRequests:instanceName:logLevel:logNoColor:
- (instancetype) initWithSsksURL:(const NSString *)ssksURL
appId:(const NSString *)appId
maxParallelRequests:(const NSInteger)maxParallelRequests
instanceName:(const NSString *)instanceName
logLevel:(const NSInteger)logLevel
logNoColor:(const BOOL)logNoColor;Initialize an instance of Seald SSKS Password plugin.
Parameters
ssksURLThe URL of the SSKS Identity Key Storage to which it should connect.appIdThe application ID to use.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 SSKS Plugin 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.
initWithSsksURL:appId:
- (instancetype) initWithSsksURL:(const NSString *)ssksURL
appId:(const NSString *)appId;saveIdentityWithUserId:password:identity:error:
- (NSString *) saveIdentityWithUserId:(const NSString *)userId
password:(const NSString *)password
identity:(const NSData *)identity
error:(NSError *_Nullable *)error;Save the given identity for the given userId, encrypted with the given password.
Parameters
userIdThe ID of the userId.passwordThe password to encrypt the key.identityThe identity to save.errorError pointer.
Returns
A NSString containing the SSKS ID of the stored identity, which can be used by your backend to manage it.
saveIdentityAsyncWithUserId:password:identity:completionHandler:
- (void) saveIdentityAsyncWithUserId:(const NSString *)userId
password:(const NSString *)password
identity:(const NSData *)identity
completionHandler:(void(^)(NSString *ssksId, NSError *_Nullable error))completionHandler;Save the given identity for the given userId, encrypted with the given password.
Parameters
userIdThe ID of the userId.passwordThe password to encrypt the key.identityThe identity to save.completionHandlerA callback called after function execution. This callback takes two arguments, aNSString*containing the SSKS ID of the stored identity, which can be used by your backend to manage it, and aNSError*that indicates if any error occurred.
saveIdentityWithUserId:rawStorageKey:rawEncryptionKey:identity:error:
- (NSString *) saveIdentityWithUserId:(const NSString *)userId
rawStorageKey:(const NSString *)rawStorageKey
rawEncryptionKey:(const NSData *)rawEncryptionKey
identity:(const NSData *)identity
error:(NSError *_Nullable *)error;Save the given identity for the given userId, encrypted with the given raw keys.
Parameters
userIdThe ID of the userId.rawStorageKeyThe key under which identity keys are stored. This MUST be a secret known only to this user of your app, and never to other users, as learning it will allow deleting the stored identities. Useful to change if you want to store multiple identities for the sameuserId. Allowed characters :A-Za-z0-9+/=-_@.. Max length is 256 characters.rawEncryptionKeyThe raw encryption key used to encrypt / decrypt the stored identity keys. This MUST be a cryptographically random NSData of 64 bytes.identityThe identity to save.errorError pointer.
Returns
A NSString containing the SSKS ID of the stored identity, which can be used by your backend to manage it.
saveIdentityAsyncWithUserId:rawStorageKey:rawEncryptionKey:identity:completionHandler:
- (void) saveIdentityAsyncWithUserId:(const NSString *)userId
rawStorageKey:(const NSString *)rawStorageKey
rawEncryptionKey:(const NSData *)rawEncryptionKey
identity:(const NSData *)identity
completionHandler:(void(^)(NSString *ssksId, NSError *_Nullable error))completionHandler;Save the given identity for the given userId, encrypted with the given raw keys.
Parameters
userIdThe ID of the userId.rawStorageKeyThe key under which identity keys are stored. This MUST be a secret known only to this user of your app, and never to other users, as learning it will allow deleting the stored identities. Useful to change if you want to store multiple identities for the sameuserId. Allowed characters :A-Za-z0-9+/=-_@.. Max length is 256 characters.rawEncryptionKeyThe raw encryption key used to encrypt / decrypt the stored identity keys. This MUST be a cryptographically random NSData of 64 bytes.identityThe identity to save.completionHandlerA callback called after function execution. This callback takes two arguments, aNSString*containing the SSKS ID of the stored identity, which can be used by your backend to manage it, and aNSError*that indicates if any error occurred.
retrieveIdentityWithUserId:password:error:
- (NSData *) retrieveIdentityWithUserId:(const NSString *)userId
password:(const NSString *)password
error:(NSError *_Nullable *)error;Retrieve the identity stored on the SSKS server for the given userId, and decrypt it with the given password.
If you use an incorrect password multiple times, the server may throttle your requests. In this case, you will receive an error Request throttled, retry after {N}s, with {N} the number of seconds during which you cannot try again.
Parameters
userIdThe ID of the userId.passwordThe password to encrypt the key.errorError pointer.
Returns
A NSData containing the retrieved identity
retrieveIdentityAsyncWithUserId:password:completionHandler:
- (void) retrieveIdentityAsyncWithUserId:(const NSString *)userId
password:(const NSString *)password
completionHandler:(void(^)(NSData *identity, NSError *_Nullable error))completionHandler;Retrieve the identity stored on the SSKS server for the given userId, and decrypt it with the given password.
If you use an incorrect password multiple times, the server may throttle your requests. In this case, you will receive an error Request throttled, retry after {N}s, with {N} the number of seconds during which you cannot try again.
Parameters
userIdThe ID of the userId.passwordThe password to encrypt the key.completionHandlerA callback called after function execution. This callback takes two arguments, aNSData*containing the retrieved identity, and aNSError*that indicates if any error occurred.
retrieveIdentityWithUserId:rawStorageKey:rawEncryptionKey:error:
- (NSData *) retrieveIdentityWithUserId:(const NSString *)userId
rawStorageKey:(const NSString *)rawStorageKey
rawEncryptionKey:(const NSData *)rawEncryptionKey
error:(NSError *_Nullable *)error;Retrieve the identity stored on the SSKS server for the given userId, and decrypt it with the given raw keys.
If you use an incorrect password multiple times, the server may throttle your requests. In this case, you will receive an error Request throttled, retry after {N}s, with {N} the number of seconds during which you cannot try again.
Parameters
userIdThe ID of the userId.rawStorageKeyThe key under which identity keys are stored. This MUST be a secret known only to this user of your app, and never to other users, as learning it will allow deleting the stored identities. Useful to change if you want to store multiple identities for the sameuserId. Allowed characters :A-Za-z0-9+/=-_@.. Max length is 256 characters.rawEncryptionKeyThe raw encryption key used to encrypt / decrypt the stored identity keys. This MUST be a cryptographically random NSData of 64 bytes.errorError pointer.
Returns
A NSData containing the retrieved identity
retrieveIdentityAsyncWithUserId:rawStorageKey:rawEncryptionKey:completionHandler:
- (void) retrieveIdentityAsyncWithUserId:(const NSString *)userId
rawStorageKey:(const NSString *)rawStorageKey
rawEncryptionKey:(const NSData *)rawEncryptionKey
completionHandler:(void(^)(NSData *identity, NSError *_Nullable error))completionHandler;Retrieve the identity stored on the SSKS server for the given userId, and decrypt it with the given raw keys.
If you use an incorrect password multiple times, the server may throttle your requests. In this case, you will receive an error Request throttled, retry after {N}s, with {N} the number of seconds during which you cannot try again.
Parameters
userIdThe ID of the userId.rawStorageKeyThe key under which identity keys are stored. This MUST be a secret known only to this user of your app, and never to other users, as learning it will allow deleting the stored identities. Useful to change if you want to store multiple identities for the sameuserId. Allowed characters :A-Za-z0-9+/=-_@.. Max length is 256 characters.rawEncryptionKeyThe raw encryption key used to encrypt / decrypt the stored identity keys. This MUST be a cryptographically random NSData of 64 bytes.completionHandlerA callback called after function execution. This callback takes two arguments, aNSData*containing the retrieved identity, and aNSError*that indicates if any error occurred.
changeIdentityPasswordWithUserId:currentPassword:newPassword:error:
- (NSString *) changeIdentityPasswordWithUserId:(const NSString *)userId
currentPassword:(const NSString *)currentPassword
newPassword:(const NSString *)newPassword
error:(NSError *_Nullable *)error;Change the password used to encrypt the identity for the userId.
Parameters
userIdThe ID of the userId.currentPasswordThe user's current password.newPasswordThe new password.errorError pointer.
Returns
A NSString containing the new SSKS ID of the stored identity.
changeIdentityPasswordAsyncWithUserId:currentPassword:newPassword:completionHandler:
- (void) changeIdentityPasswordAsyncWithUserId:(const NSString *)userId
currentPassword:(const NSString *)currentPassword
newPassword:(const NSString *)newPassword
completionHandler:(void(^)(NSString *ssksId, NSError *_Nullable error))completionHandler;Change the password used to encrypt the identity for the userId.
Parameters
userIdThe ID of the userId.currentPasswordThe user's current password.newPasswordThe new password.completionHandlerA callback called after function execution. This callback takes two arguments, aNSString*containing the new SSKS ID of the stored identity, and aNSError*that indicates if any error occurred.