class SealdSsksTMRPlugin
@interface SealdSsksTMRPlugin : NSObject
The SealdSSKSTmrPlugin class allows to use the SSKS key storage service to store Seald identities easily and securely, encrypted by a key stored on your back-end server.
Members | Descriptions |
---|---|
initWithSsksURL:appId:instanceName:logLevel:logNoColor: | Initialize an instance of Seald SSKS TMR plugin. |
initWithSsksURL:appId: | |
saveIdentity:authFactor:rawTMRSymKey:identity:challenge:error: | Save the Seald account to SSKS. |
saveIdentity:authFactor:rawTMRSymKey:identity:error: | Save the Seald account to SSKS. |
saveIdentityAsync:authFactor:rawTMRSymKey:identity:challenge:completionHandler: | Save the Seald account to SSKS. |
saveIdentityAsync:authFactor:rawTMRSymKey:identity:completionHandler: | Save the Seald account to SSKS. |
retrieveIdentity:authFactor:rawTMRSymKey:challenge:error: | Retrieve the Seald account previously saved with [ssksTMRPluginInstance saveIdentity] . |
retrieveIdentity:authFactor:rawTMRSymKey:error: | Retrieve the Seald account previously saved with [ssksTMRPluginInstance saveIdentity] . |
retrieveIdentityAsync:authFactor:rawTMRSymKey:challenge:completionHandler: | Retrieve the Seald account previously saved with [ssksTMRPluginInstance saveIdentity] . |
retrieveIdentityAsync:authFactor:rawTMRSymKey:completionHandler: | Retrieve the Seald account previously saved with [ssksTMRPluginInstance saveIdentity] . |
getFactorToken:authFactor:challenge:error: | Retrieve the TMR JWT associated with an authentication factor. |
getFactorToken:authFactor:error: | Retrieve the TMR JWT associated with an authentication factor. |
getFactorTokenAsync:authFactor:challenge:completionHandler: | Retrieve the TMR JWT associated with an authentication factor. |
getFactorTokenAsync:authFactor:completionHandler: | Retrieve the TMR JWT associated with an authentication factor. |
initWithSsksURL:appId:instanceName:logLevel:logNoColor:
- (instancetype) initWithSsksURL:(const NSString *)ssksURL
appId:(const NSString *)appId
instanceName:(const NSString *)instanceName
logLevel:(const NSInteger)logLevel
logNoColor:(const BOOL)logNoColor;
Initialize an instance of Seald SSKS TMR plugin.
Parameters
ssksURL
The URL of the SSKS Identity Key Storage to which it should connect.appId
The application ID to use.instanceName
An arbitrary name to give to this SSKS Plugin. 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.
initWithSsksURL:appId:
- (instancetype) initWithSsksURL:(const NSString *)ssksURL
appId:(const NSString *)appId;
saveIdentity:authFactor:rawTMRSymKey:identity:challenge:error:
- (SealdSsksSaveIdentityResponse *) saveIdentity:(const NSString *)sessionId
authFactor:(const SealdTmrAuthFactor *)authFactor
rawTMRSymKey:(const NSData *)rawTMRSymKey
identity:(const NSData *)identity
challenge:(const NSString *_Nullable)challenge
error:(NSError *_Nullable *)error;
Save the Seald account to SSKS.
Parameters
sessionId
The user's session ID.authFactor
The authentication factor to use.rawTMRSymKey
The raw encryption key used to encrypt / decrypt the stored identity keys. This MUST be a cryptographically random NSData of 64 bytes.identity
The identity to save.challenge
Optional. The challenge sent by SSKS to the user's authentication method, if any.error
Error pointer.
Returns
A SealdSsksSaveIdentityResponse instance, containing the SSKS ID of the stored identity, which can be used by your backend to manage it, and if a challenge was passed authenticatedSessionId
, a new authenticated sessionId, that you can use to perform further SSKS TMR operations without challenge.
saveIdentity:authFactor:rawTMRSymKey:identity:error:
- (SealdSsksSaveIdentityResponse *) saveIdentity:(const NSString *)sessionId
authFactor:(const SealdTmrAuthFactor *)authFactor
rawTMRSymKey:(const NSData *)rawTMRSymKey
identity:(const NSData *)identity
error:(NSError *_Nullable *)error;
Save the Seald account to SSKS.
Parameters
sessionId
The user's session ID.authFactor
The authentication factor to use.rawTMRSymKey
The raw encryption key used to encrypt / decrypt the stored identity keys. This MUST be a cryptographically random NSData of 64 bytes.identity
The identity to save.error
Error pointer.
Returns
A SealdSsksSaveIdentityResponse instance, containing the SSKS ID of the stored identity, which can be used by your backend to manage it, and if a challenge was passed authenticatedSessionId
, a new authenticated sessionId, that you can use to perform further SSKS TMR operations without challenge.
saveIdentityAsync:authFactor:rawTMRSymKey:identity:challenge:completionHandler:
- (void) saveIdentityAsync:(const NSString *)sessionId
authFactor:(const SealdTmrAuthFactor *)authFactor
rawTMRSymKey:(const NSData *)rawTMRSymKey
identity:(const NSData *)identity
challenge:(const NSString *_Nullable)challenge
completionHandler:(void(^)(SealdSsksSaveIdentityResponse *response, NSError *_Nullable error))completionHandler;
Save the Seald account to SSKS.
Parameters
sessionId
The user's session ID.authFactor
The authentication factor to use.rawTMRSymKey
The raw encryption key used to encrypt / decrypt the stored identity keys. This MUST be a cryptographically random NSData of 64 bytes.identity
The identity to save.challenge
Optional. The challenge sent by SSKS to the user's authentication method, if any.completionHandler
A callback called after function execution. This callback take two arguments, aSealdSsksSaveIdentityResponse*
containing the SSKS ID of the saved identity, and aNSError*
that indicates if any error occurred.
saveIdentityAsync:authFactor:rawTMRSymKey:identity:completionHandler:
- (void) saveIdentityAsync:(const NSString *)sessionId
authFactor:(const SealdTmrAuthFactor *)authFactor
rawTMRSymKey:(const NSData *)rawTMRSymKey
identity:(const NSData *)identity
completionHandler:(void(^)(SealdSsksSaveIdentityResponse *response, NSError *_Nullable error))completionHandler;
Save the Seald account to SSKS.
Parameters
sessionId
The user's session ID.authFactor
The authentication factor to use.rawTMRSymKey
The raw encryption key used to encrypt / decrypt the stored identity keys. This MUST be a cryptographically random NSData of 64 bytes.identity
The identity to save.completionHandler
A callback called after function execution. This callback take two arguments, aSealdSsksSaveIdentityResponse*
containing the SSKS ID of the saved identity, and aNSError*
that indicates if any error occurred.
retrieveIdentity:authFactor:rawTMRSymKey:challenge:error:
- (SealdSsksRetrieveIdentityResponse *) retrieveIdentity:(const NSString *)sessionId
authFactor:(const SealdTmrAuthFactor *)authFactor
rawTMRSymKey:(const NSData *)rawTMRSymKey
challenge:(const NSString *_Nullable)challenge
error:(NSError *_Nullable *)error;
Retrieve the Seald account previously saved with [ssksTMRPluginInstance saveIdentity]
.
Parameters
sessionId
The user's session ID.authFactor
The authentication factor to use.rawTMRSymKey
The raw encryption key used to encrypt / decrypt the stored identity keys. This MUST be a cryptographically random NSData of 64 bytes.challenge
Optional. The challenge sent by SSKS to the user's authentication method, if any.error
Error pointer.
Returns
A SealdSsksRetrieveIdentityResponse instance, containing identity
, the retrieved identity, shouldRenewKey
, a boolean set to true is the user private key should be renewed (using [sealdSDKInstance renewKeys]), and authenticatedSessionId
, a new authenticated sessionId, that you can use to perform further SSKS TMR operations without challenge.
retrieveIdentity:authFactor:rawTMRSymKey:error:
- (SealdSsksRetrieveIdentityResponse *) retrieveIdentity:(const NSString *)sessionId
authFactor:(const SealdTmrAuthFactor *)authFactor
rawTMRSymKey:(const NSData *)rawTMRSymKey
error:(NSError *_Nullable *)error;
Retrieve the Seald account previously saved with [ssksTMRPluginInstance saveIdentity]
.
Parameters
sessionId
The user's session ID.authFactor
The authentication factor to use.rawTMRSymKey
The raw encryption key used to encrypt / decrypt the stored identity keys. This MUST be a cryptographically random NSData of 64 bytes.error
Error pointer.
Returns
A SealdSsksRetrieveIdentityResponse instance, containing identity
, the retrieved identity, shouldRenewKey
, a boolean set to true is the user private key should be renewed (using [sealdSDKInstance renewKeys]), and authenticatedSessionId
, a new authenticated sessionId, that you can use to perform further SSKS TMR operations without challenge.
retrieveIdentityAsync:authFactor:rawTMRSymKey:challenge:completionHandler:
- (void) retrieveIdentityAsync:(const NSString *)sessionId
authFactor:(const SealdTmrAuthFactor *)authFactor
rawTMRSymKey:(const NSData *)rawTMRSymKey
challenge:(const NSString *_Nullable)challenge
completionHandler:(void(^)(SealdSsksRetrieveIdentityResponse *response, NSError *_Nullable error))completionHandler;
Retrieve the Seald account previously saved with [ssksTMRPluginInstance saveIdentity]
.
Parameters
sessionId
The user's session ID.authFactor
The authentication factor to use.rawTMRSymKey
The raw encryption key used to encrypt / decrypt the stored identity keys. This MUST be a cryptographically random NSData of 64 bytes.challenge
Optional. The challenge sent by SSKS to the user's authentication method, if any.completionHandler
A callback called after function execution. This callback take two arguments, aSealdSsksRetrieveIdentityResponse*
containing the retrieved identity, and aNSError*
that indicates if any error occurred.
retrieveIdentityAsync:authFactor:rawTMRSymKey:completionHandler:
- (void) retrieveIdentityAsync:(const NSString *)sessionId
authFactor:(const SealdTmrAuthFactor *)authFactor
rawTMRSymKey:(const NSData *)rawTMRSymKey
completionHandler:(void(^)(SealdSsksRetrieveIdentityResponse *response, NSError *_Nullable error))completionHandler;
Retrieve the Seald account previously saved with [ssksTMRPluginInstance saveIdentity]
.
Parameters
sessionId
The user's session ID.authFactor
The authentication factor to use.rawTMRSymKey
The raw encryption key used to encrypt / decrypt the stored identity keys. This MUST be a cryptographically random NSData of 64 bytes.completionHandler
A callback called after function execution. This callback take two arguments, aSealdSsksRetrieveIdentityResponse*
containing the retrieved identity, and aNSError*
that indicates if any error occurred.
getFactorToken:authFactor:challenge:error:
- (SealdSsksGetFactorTokenResponse *) getFactorToken:(const NSString *)sessionId
authFactor:(const SealdTmrAuthFactor *)authFactor
challenge:(const NSString *_Nullable)challenge
error:(NSError *_Nullable *)error;
Retrieve the TMR JWT associated with an authentication factor.
Parameters
sessionId
Session ID given by SSKS to your app's server.authFactor
Authentication method of this user, to which SSKS has sent a challenge at the request of your app's server.challenge
Optional. The challenge sent by SSKS to the user's authentication method, if any.error
Error pointer.
Returns
An [GetFactorTokenResponse] instance, containing the retrieved authentication factor token.
getFactorToken:authFactor:error:
- (SealdSsksGetFactorTokenResponse *) getFactorToken:(const NSString *)sessionId
authFactor:(const SealdTmrAuthFactor *)authFactor
error:(NSError *_Nullable *)error;
Retrieve the TMR JWT associated with an authentication factor.
Parameters
sessionId
Session ID given by SSKS to your app's server.authFactor
Authentication method of this user, to which SSKS has sent a challenge at the request of your app's server.error
Error pointer.
Returns
An [GetFactorTokenResponse] instance, containing the retrieved authentication factor token.
getFactorTokenAsync:authFactor:challenge:completionHandler:
- (void) getFactorTokenAsync:(const NSString *)sessionId
authFactor:(const SealdTmrAuthFactor *)authFactor
challenge:(const NSString *_Nullable)challenge
completionHandler:(void(^)(SealdSsksGetFactorTokenResponse *response, NSError *_Nullable error))completionHandler;
Retrieve the TMR JWT associated with an authentication factor.
Parameters
sessionId
Session ID given by SSKS to your app's server.authFactor
Authentication method of this user, to which SSKS has sent a challenge at the request of your app's server.challenge
Optional. The challenge sent by SSKS to the user's authentication method, if any.completionHandler
A callback called after function execution. This callback take two arguments, aSealdSsksGetFactorTokenResponse*
containing the retrieved token, and aNSError*
that indicates if any error occurred.
getFactorTokenAsync:authFactor:completionHandler:
- (void) getFactorTokenAsync:(const NSString *)sessionId
authFactor:(const SealdTmrAuthFactor *)authFactor
completionHandler:(void(^)(SealdSsksGetFactorTokenResponse *response, NSError *_Nullable error))completionHandler;
Retrieve the TMR JWT associated with an authentication factor.
Parameters
sessionId
Session ID given by SSKS to your app's server.authFactor
Authentication method of this user, to which SSKS has sent a challenge at the request of your app's server.completionHandler
A callback called after function execution. This callback take two arguments, aSealdSsksGetFactorTokenResponse*
containing the retrieved token, and aNSError*
that indicates if any error occurred.