LocalDataManager
public protocol LocalDataManager
An interface that provides information about the data stored locally in the SDK. This includes authenticator and dispatch target information. The protocol also allows to delete the data locally.
-
Returns information about all authenticators. This information contains whether the authenticator is registered/enrolled or not.
Declaration
Swift
func authenticators() -> [AuthenticatorInformation]
Return Value
an array of
AuthenticatorInformation
. -
Deletes all the data managed by the SDK regarding the provided authenticator. If the authenticator is registered, it will delete the associated FIDO UAF credentials. If the authenticator is managed by the SDK (PIN authenticator) it will also delete the stored credentials (i.e. the authenticator will no longer be enrolled).
NOTE: this method will only delete data locally. The FIDO UAF credentials will not be deleted from the server. This method should be used
- when going through the
deregister
operation to delete authenticator information is not possible. For instance when the PIN authenticator is locked, which may be due to a security attack and then it is desirable to delete the credentials locally. - when doing the
registration
operation with PIN authenticator, but the operation is not completed. In this case the enrollment of the PIN authenticator (even if it is in lockout state) can be deleted by calling this function.
NOTE:
FIDOError.protocolError
is thrown in case of multi-account is detected.Declaration
Swift
func deleteAuthenticator(aaid: String, completion handler: @escaping (Result<(), Error>) -> ())
Parameters
aaid
The AAID of the
Authenticator
whose data must be deleted.completion
Handler which is called when the deletion is done or failed due to an error.
- when going through the
-
Deletes all the data managed by the SDK regarding the provided authenticator in association with a given username. If the authenticator is registered, it will delete the associated FIDO UAF credentials. If the authenticator is managed by the SDK (PIN authenticator) it will also delete the stored credentials (i.e. the authenticator will no longer be enrolled).
NOTE: this method will only delete data locally. The FIDO UAF credentials will not be deleted from the server. This method should be used
- when going through the
deregister
operation to delete authenticator information is not possible. For instance when the PIN authenticator is locked, which may be due to a security attack and then it is desirable to delete the credentials locally. when doing the
registration
operation with PIN authenticator, but the operation is not completed. In this case the enrollment of the PIN authenticator (even if it is in lockout state) can be deleted by calling this function.
Declaration
Swift
func deleteAuthenticator(for username: Username, aaid: String, completion handler: @escaping (Result<(), Error>) -> ())
Parameters
username
The user whose data must be deleted.
aaid
The AAID of the
Authenticator
whose data must be deleted.completion
Handler which is called when the deletion is done or failed due to an error.
- when going through the
-
Returns information about the configured
DispatchTarget
if any, nil otherwise.Declaration
Swift
func dispatchTarget() -> DispatchTargetConfiguration?
Return Value
-
Deletes the configured dispatch target.
NOTE:
FIDOError.protocolError
is thrown in case of multi-account is detected.Declaration
Swift
func deleteDispatchTarget(completion handler: @escaping (Result<(), Error>) -> ())
Parameters
completion
handler which is called when the deletion is done or failed due to an error.
-
Deletes the configured dispatch target.
Declaration
Swift
func deleteDispatchTarget(for username: Username, completion handler: @escaping (Result<(), Error>) -> ())
Parameters
username
The user whose target must be deleted.
completion
handler which is called when the deletion is done or failed due to an error.
-
Deletes all the data stored by the SDK locally.
Declaration
Swift
func deleteAllData(completion handler: @escaping (Result<(), Error>) -> ())
Parameters
completion
handler which is called when the deletion is done or failed due to an error.
-
Deletes all the data associated to a user stored by the SDK locally.
Declaration
Swift
func deleteAllData(for username: Username, completion handler: @escaping (Result<(), Error>) -> ())
Parameters
username
The user whose data must be deleted.
completion
handler which is called when the deletion is done or failed due to an error.
-
Required for the Unified API to decrypt data received from nevisFIDO.
Throws
NevisError.malformedNmaData
if payload contains a malformed json.NevisError.invalidDispatchTarget
if decryption fails.
Declaration
Swift
func decryptNmaData(from payload: OutOfBandPayload) throws -> RedeemToken
Parameters
payload
OutOfBandPayload
which is used for the Out-of-band operation inOutOfBandOperations.process()
Return Value
The decrypted
RedeemToken
containing the redeem token and redemption URL.