EMCapFactory

Objective-C


@interface EMCapFactory : NSObject

Swift

class EMCapFactory : NSObject

A factory for creating objects that produce or affect CAP (or its relatives) OTPs.

  • Creates a Hardware or Software CAP device for the given CAP token.

    If the token is soft, i.e [EMToken isSoft] is YES, the default CAP settings are used, otherwise the device settings are used.

    Warning

    Currently Mobile Protector SDK library only supports Software CAP device.

    Since

    4.0

    Declaration

    Objective-C

    - (id<EMCapDevice>)createCapDeviceWithToken:(id<EMCapToken>)token
                                          error:(NSError **)error;

    Swift

    func createCapDevice(with token: (any EMCapToken)!) throws -> any EMCapDevice

    Parameters

    token

    The CAP token.

    error

    If an error occurs, upon return contains an NSError object that describes the problem. If you are not interested in possible errors, you may pass in NULL.

    Return Value

    The CAP device.

  • Returns a mutable copy of the default CAP settings used for soft tokens.

    Since

    4.0

    Declaration

    Objective-C

    - (id<EMMutableSoftCapSettings>)mutableSoftCapSettings;

    Swift

    func mutableSoftCapSettings() -> (any EMMutableSoftCapSettings)!

    Return Value

    Mutable CAP settings based on the default cap settings.

  • Creates a Software CAP device for the given token using the given settings.

    This method may only be used for soft tokens, i.e [EMToken isSoft] is YES.

    Since

    4.0

    Declaration

    Objective-C

    - (id<EMCapDevice>)createSoftCapDeviceWithToken:(id<EMSoftCapToken>)token
                                           settings:(id<EMSoftCapSettings>)settings
                                              error:(NSError **)error;

    Swift

    func createSoftCapDevice(with token: (any EMSoftCapToken)!, settings: (any EMSoftCapSettings)!) throws -> any EMCapDevice

    Parameters

    token

    The CAP token.

    settings

    The CAP settings.

    error

    If an error occurs, upon return contains an NSError object that describes the problem. If you are not interested in possible errors, you may pass in NULL.

    Return Value

    The cap device.