EMCapTools Class Reference

Inherits from NSObject
Declared in EMCapTools.h

Overview

CAP Tools

+ prefixSequenceNumberToOtp:token:tokenVersionLength:

Prefixes an OTP value with a token sequence number, zero padded to the left.

+ (id<EMSecureString>)prefixSequenceNumberToOtp:(id<EMSecureString>)otp token:(id<EMToken>)token tokenVersionLength:(int)tokenVersionLength

Parameters

otp

OTP to prefix.

token

The token which generated the OTP. Only significant digits will be used.

tokenVersionLength

Number of digits to prefix, if needed the token.tokenSequenceNumber will be zero padded to the left. Maximum length is 3, cannot be 0.

tokenVersionLength Prefix range
1 1 - 9
2 01 - 99
3 001 - 255

Return Value

The OTP value prefixed.

Discussion

Warning: This method should be used when token has been provisioned with provisioning protocol v1.

Warning: The token sequence number is not defined for OATH tokens. All OATH tokens will be assigned to the default value as 0xFF.

Exceptions

NSInvalidArgumentException
  • when the tokens sequence number is invalid or the tokenVersionLength is less then the actual length.

Declared In

EMCapTools.h

+ prefixSequenceNumberToOtp:token:

Prefixes an OTP value with a token sequence number, zero padded to the left.

+ (id<EMSecureString>)prefixSequenceNumberToOtp:(id<EMSecureString>)otp token:(id<EMToken>)token

Parameters

otp

OTP to prefix.

token

The token which generated the OTP. Only significant digits will be used.

Return Value

The OTP value prefixed.

Discussion

Warning: This method should be used when token has been provisioned with provisioning protocol v1.

Exceptions

NSInvalidArgumentException
  • when token’s sequence number is invalid.

Declared In

EMCapTools.h

+ prefixSequenceNumberAsHexToOtp:token:

Prefixes an OTP value with a token sequence number as hexadecimal digits.

+ (id<EMSecureString>)prefixSequenceNumberAsHexToOtp:(id<EMSecureString>)otp token:(id<EMToken>)token

Parameters

otp

OTP to prefix.

token

The token which generated the OTP. Only significant digits will be used.

Return Value

The OTP value prefixed.

Discussion

Warning: This method should be used when token has been provisioned with provisioning protocol v2.

Warning: The token sequence number is not defined for OATH tokens. All OATH tokens will be assigned to the default value as 0xFF.

Exceptions

NSInvalidArgumentException
  • when token’s sequence number is invalid.

Declared In

EMCapTools.h