EMCapMobileProtector

@interface EMCapMobileProtector : EMMobileProtector

A class that manages the token devices. This class could be use to do Token Device management such as creating the token through provisioning process also getting and removing it.

  • - Since: 5.3
  • Singleton instance of EMCapMobileProtector

    Declaration

    Objective-C

    + (nullable instancetype)sharedInstance;

    Swift

    class func sharedInstance() -> Self?

    Return Value

    The singleton EMCapMobileProtector instance. This method requires EMCapMobileProtector to be created on EMFastTrack.

  • Retrieve the Set of names of existing EMProtectorCapTokenDevice in the database.

    Declaration

    Objective-C

    - (nullable NSSet<NSString *> *)tokenDeviceNamesWithError:
        (NSError *_Nullable *_Nullable)error;

    Swift

    func tokenDeviceNames() throws -> Set<String>

    Parameters

    error

    If an error occurs, upon return contains an NSError object that describes the problem.

    Return Value

    The set of names of existing TokenDevices. Could return empty if there’s no token device in the database.

  • Retrieve the EMProtectorCapTokenDevice with given name.

    Declaration

    Objective-C

    - (nullable EMProtectorCapTokenDevice *)
          tokenDeviceWithName:(nonnull NSString *)tokenDeviceName
        fingerprintCustomData:(nullable NSData *)fingerprintCustomData
                        error:(NSError *_Nullable *_Nullable)error;

    Swift

    func tokenDevice(name tokenDeviceName: String, fingerprintCustomData: Data?) throws -> EMProtectorCapTokenDevice

    Parameters

    tokenDeviceName

    The token device name.

    fingerprintCustomData

    The fingerprint custom data. This data is mandatory if the EMFastTrackDeviceFingerprintSource customData is set on EMProvisionerOptionalParameters during provisioning.

    error

    If an error occurs, upon return contains an NSError object that describes the problem

    Return Value

    The EMProtectorCapTokenDevice object

  • Retrieve the EMProtectorCapTokenDevice with user token ID.

    Declaration

    Objective-C

    - (nullable EMProtectorCapTokenDevice *)
        tokenDeviceWithUserTokenID:(int)userTokenID
             fingerprintCustomData:(nullable NSData *)fingerprintCustomData
                             error:(NSError *_Nullable *_Nullable)error;

    Swift

    func tokenDevice(userTokenID: Int32, fingerprintCustomData: Data?) throws -> EMProtectorCapTokenDevice

    Parameters

    userTokenID

    The userTokenID.

    fingerprintCustomData

    The fingerprint custom data. This data is mandatory if the EMFastTrackDeviceFingerprintSource customData is set on EMProvisionerOptionalParameters during provisioning.

    error

    If an error occurs, upon return contains an NSError object that describes the problem

    Return Value

    The EMProtectorCapTokenDevice object

  • Remove EMProtectorCapTokenDevice from database with given name.

    Declaration

    Objective-C

    - (BOOL)removeTokenDeviceWithName:(nonnull NSString *)tokenDeviceName
                                error:(NSError *_Nullable *_Nullable)error;

    Swift

    func removeTokenDevice(name tokenDeviceName: String) throws

    Parameters

    tokenDeviceName

    The token name.

    error

    If an error occurs, upon return contains an NSError object that describes the problem

    Return Value

    YES if the succeeded. Otherwise NO

  • Starts the creation of a new EMProtectorCapTokenDevice. If there’s a token device that has the same name in the database, the provisioning process will stop and an error will be return.

    Declaration

    Objective-C

    - (void)
        provisionWithTokenDeviceName:(nonnull NSString *)tokenDeviceName
                    registrationCode:(nonnull NSString *)registrationCode
                         capSettings:(nonnull EMProtectorCapSettings *)capSettings
                  optionalParameters:
                      (nullable void (^)(EMProvisionerOptionalParameters *_Nonnull))
                          optionalParameters
                   completionHandler:
                       (nonnull void (^)(EMProtectorCapTokenDevice *_Nullable,
                                         NSDictionary *_Nullable,
                                         NSError *_Nullable))completionHandler;

    Swift

    func provision(tokenDeviceName: String, registrationCode: String, capSettings: EMProtectorCapSettings, optionalParameters: ((EMProvisionerOptionalParameters) -> Void)?, completionHandler: @escaping (EMProtectorCapTokenDevice?, [AnyHashable : Any]?, Error?) -> Void)

    Parameters

    tokenDeviceName

    The token device name.

    registrationCode

    The registration code. For Protocol Version 3, minimum registration code length is 2, and maximum registration code length is 14. For Protocol Version 5, minimum registration code length is 6, and maximum registration code length is 32

    capSettings

    The OTP settings, - see: EMFastTrackCapSettings. This settings are persisted and will be used later by OTP generation.

    optionalParameters

    The optional parameters, - see: EMProvisionerOptionalParameters

    completionHandler

    A callback from provisioning that contains EMProtectorCapTokenDevice if there’s no error also a provisioning extensions that was set by the bank during enrollment process.

  • Deprecated

    This API is deprecated since 6.0. Use ‘tokenDeviceWithName:fingerprintCustomData:capSettings:error’ or ‘tokenDeviceWithUserTokenID:fingerprintCustomData:capSettings:error’ instead.

    Store the previously used CapSettings into a storage so it can be use later during otp generation. Only useful when upgrading from previous version of Mobile Protector SDK.

    Declaration

    Objective-C

    - (BOOL)persistSettingsWithTokenDeviceName:(nonnull NSString *)tokenDeviceName
                                   capSettings:
                                       (nonnull EMProtectorCapSettings *)capSettings
                                         error:(NSError *_Nullable *_Nullable)error;

    Swift

    func persistSettings(tokenDeviceName: String, capSettings: EMProtectorCapSettings) throws

    Parameters

    tokenDeviceName

    The token device name.

    capSettings

    The CAP OTP settings that should be the same as the policy on the authentication server. This settings are persisted and will be used later by OTP generation.

    error

    If an error occurs, upon return contains an NSError object that describes the problem

    Return Value

    YES if the succeeded. Otherwise NO

  • Retrieve the EMProtectorCapTokenDevice with given name and capSettings.

    Since

    6.0

    Declaration

    Objective-C

    - (nullable EMProtectorCapTokenDevice *)
          tokenDeviceWithName:(nonnull NSString *)tokenDeviceName
        fingerprintCustomData:(nullable NSData *)fingerprintCustomData
                  capSettings:(nonnull EMProtectorCapSettings *)capSettings
                        error:(NSError *_Nullable *_Nullable)error;

    Swift

    func tokenDevice(name tokenDeviceName: String, fingerprintCustomData: Data?, capSettings: EMProtectorCapSettings) throws -> EMProtectorCapTokenDevice

    Parameters

    tokenDeviceName

    The token device name.

    fingerprintCustomData

    The fingerprint custom data. This data is mandatory if the EMFastTrackDeviceFingerprintSource customData is set on EMProvisionerOptionalParameters during provisioning.

    capSettings

    The CAP OTP settings that should be the same as the policy on the authentication server.

    error

    If an error occurs, upon return contains an NSError object that describes the problem

    Return Value

    The EMProtectorCapTokenDevice object

  • Retrieve the EMProtectorCapTokenDevice with user token ID and capSettings.

    Since

    6.0

    Declaration

    Objective-C

    - (nullable EMProtectorCapTokenDevice *)
        tokenDeviceWithUserTokenID:(int)userTokenID
             fingerprintCustomData:(nullable NSData *)fingerprintCustomData
                       capSettings:(nonnull EMProtectorCapSettings *)capSettings
                             error:(NSError *_Nullable *_Nullable)error;

    Swift

    func tokenDevice(userTokenID: Int32, fingerprintCustomData: Data?, capSettings: EMProtectorCapSettings) throws -> EMProtectorCapTokenDevice

    Parameters

    userTokenID

    The userTokenID

    fingerprintCustomData

    The fingerprint custom data. This data is mandatory if the EMFastTrackDeviceFingerprintSource customData is set on EMProvisionerOptionalParameters during provisioning.

    capSettings

    The CAP OTP settings that should be the same as the policy on the authentication server.

    error

    If an error occurs, upon return contains an NSError object that describes the problem

    Return Value

    The EMProtectorCapTokenDevice object