EMProtectorCapTokenDevice
Objective-C
@interface EMProtectorCapTokenDevice : EMProtectorTokenDevice
Swift
class EMProtectorCapTokenDevice : EMProtectorTokenDevice
A class defining a device that generates CAP based OTPs.
- - Since: 5.3
-
Creates a mode 1 OTP.
The typical use case of this OTP is for purchasing items from a merchant.
Declaration
Objective-C
- (nullable NSString *)otpMode1WithPin:(nonnull NSString *)pin challenge:(nonnull NSString *)challenge amount:(nullable NSString *)amount currencyCode:(nullable NSString *)currencyCode error:(NSError *_Nullable *_Nullable)error;Swift
func otpMode1(withPin pin: String, challenge: String, amount: String?, currencyCode: String?) throws -> StringParameters
pinThe pin.
challengeThe merchant challenge: An unpredictable number of up to 8 hexadecimal digits.
amountThe amount of the transaction. This value should only contain digits and can not be
nil, empty string is a valid input. Minimum digit length is 0 and maximum is 12. The SDK takes the original value of the amount, there will be no truncate, rounding off or append. This feature should be done by the application.currencyCodeThe currency as an ISO 4217 currency code, for example “USD”. for United States Dollar.
errorIf an error occurs, upon return contains an
NSErrorobject that describes the problem.Return Value
The mode 1 OTP.
-
Creates a mode 1 OTP with AuthInput.
The typical use case of this OTP is for purchasing items from a merchant.
Declaration
Objective-C
- (nullable NSString *) otpMode1WithAuthInput:(nonnull EMProtectorAuthInput *)authInput challenge:(nonnull NSString *)challenge amount:(nullable NSString *)amount currencyCode:(nullable NSString *)currencyCode error:(NSError *_Nullable *_Nullable)error;Swift
func otpMode1(with authInput: EMProtectorAuthInput, challenge: String, amount: String?, currencyCode: String?) throws -> StringParameters
authInputThe authInput.
challengeThe merchant challenge: An unpredictable number of up to 8 hexadecimal digits.
amountThe amount of the transaction. This value should only contain digits and can not be
nil, empty string is a valid input. Minimum digit length is 0 and maximum is 12. The SDK takes the original value of the amount, there will be no truncate, rounding off or append. This feature should be done by the application.currencyCodeThe currency as an ISO 4217 currency code, for example “USD”. for United States Dollar.
errorIf an error occurs, upon return contains an
NSErrorobject that describes the problem.Return Value
The mode 1 OTP.
-
Creates a mode 2 OTP.
The typical use case of this mode is for simple authentication.
Declaration
Objective-C
- (nullable NSString *)otpMode2WithPin:(nonnull NSString *)pin error:(NSError *_Nullable *_Nullable)error;Swift
func otpMode2(withPin pin: String) throws -> StringParameters
pinThe pin.
errorIf an error occurs, upon return contains an
NSErrorobject that describes the problem.Return Value
The mode 2 OTP.
-
Creates a mode 2 OTP with AuthInput.
The typical use case of this mode is for simple authentication.
Declaration
Objective-C
- (nullable NSString *) otpMode2WithAuthInput:(nonnull EMProtectorAuthInput *)authInput error:(NSError *_Nullable *_Nullable)error;Swift
func otpMode2(with authInput: EMProtectorAuthInput) throws -> StringParameters
authInputThe authInput.
errorIf an error occurs, upon return contains an
NSErrorobject that describes the problem.Return Value
The mode 2 OTP.
-
Creates a mode 2 transaction data signature OTP.
The typical use case of this mode is for signing a set of transaction data. One such example is to sign the destination bank account in a transaction.
Declaration
Objective-C
- (nullable NSString *)otpMode2TdsWithPin:(nonnull NSString *)pin dataToSign:(nonnull NSMutableArray *)dataToSign error:(NSError *_Nullable *_Nullable)error;Swift
func otpMode2Tds(withPin pin: String, dataToSign: NSMutableArray) throws -> StringParameters
pinThe pin.
dataToSignThe data to sign. Data should only contain digits, maximum 10 digit per data and maximum 10 data fields in the list. Don’t pass empty data, at least one non-empty data is required.
errorIf an error occurs, upon return contains an
NSErrorobject that describes the problem.Return Value
The mode 2 TDS OTP.
-
Creates a mode 2 transaction data signature OTP with authInput.
The typical use case of this mode is for signing a set of transaction data. One such example is to sign the destination bank account in a transaction.
Declaration
Objective-C
- (nullable NSString *) otpMode2TdsWithAuthInput:(nonnull EMProtectorAuthInput *)authInput dataToSign:(nonnull NSMutableArray *)dataToSign error:(NSError *_Nullable *_Nullable)error;Swift
func otpMode2Tds(with authInput: EMProtectorAuthInput, dataToSign: NSMutableArray) throws -> StringParameters
authInputThe authInput.
dataToSignThe data to sign. Data should only contain digits, maximum 10 digit per data and maximum 10 data fields in the list. Don’t pass empty data, at least one non-empty data is required.
errorIf an error occurs, upon return contains an
NSErrorobject that describes the problem.Return Value
The mode 2 TDS OTP.
-
Creates a Mode3 OTP.
The typical use case of this mode is for challenge/response. One such example is to log into a bank’s website.
Declaration
Objective-C
- (nullable NSString *)otpMode3WithPin:(nonnull NSString *)pin challenge:(nonnull NSString *)challenge error:(NSError *_Nullable *_Nullable)error;Swift
func otpMode3(withPin pin: String, challenge: String) throws -> StringParameters
pinThe pin.
challengeThe login challenge: An unpredictable number of up to 8 hexadecimal digits.
errorIf an error occurs, upon return contains an
NSErrorobject that describes the problem.Return Value
The mode 3 OTP.
-
Creates a Mode3 OTP with AuthInput.
The typical use case of this mode is for challenge/response. One such example is to log into a bank’s website.
Declaration
Objective-C
- (nullable NSString *) otpMode3WithAuthInput:(nonnull EMProtectorAuthInput *)authInput challenge:(nonnull NSString *)challenge error:(NSError *_Nullable *_Nullable)error;Swift
func otpMode3(with authInput: EMProtectorAuthInput, challenge: String) throws -> StringParameters
authInputThe authInput.
challengeThe login challenge: An unpredictable number of up to 8 hexadecimal digits.
errorIf an error occurs, upon return contains an
NSErrorobject that describes the problem.Return Value
The mode 3 OTP.
-
Checks if amount is required for a mode 1 operation.
Declaration
Objective-C
- (BOOL)isMode1AmountRequired;Swift
func isMode1AmountRequired() -> BoolReturn Value
YESif amount is required,NOotherwise. -
Checks if currency is required for a mode 1 operation
Declaration
Objective-C
- (BOOL)isMode1CurrencyRequired;Swift
func isMode1CurrencyRequired() -> BoolReturn Value
YESif amount is required,NOotherwise.
EMProtectorCapTokenDevice Class Reference