EMGemaltoOathDevice

Objective-C

@protocol EMGemaltoOathDevice <NSObject>

Swift

protocol EMGemaltoOathDevice : NSObjectProtocol

An OATH device complying with the Standard Gemalto OATH options.

Since

2.2
  • Gets an event based OTP (HOTP) as defined by the Gemalto OATH eBanking options.

    Warning

    Depending of the EMAuthInput type you are using, you may have to use this function asynchronously, please - see: EMAuthInput for more details

    Since

    3.2

    Declaration

    Objective-C

    - (id<EMSecureString>)hotpWithAuthInput:(id<EMAuthInput>)authInput
                                      error:(NSError **)error;

    Swift

    func hotp(with authInput: (any EMAuthInput)!) throws -> any EMSecureString

    Parameters

    authInput

    The authInput.

    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. @exception NSInternalInconsistencyException When the associated token has the EMTokenCapabilityDUAL_SEED capability since only time based algorithms are supported for this capability. See EMTokenCapability.

    Return Value

    The OTP.

  • Gets a time based OTP (TOTP) as defined by the Gemalto OATH eBanking options.

    Warning

    Depending of the EMAuthInput type you are using, you may have to use this function asynchronously, please - see: EMAuthInput for more details

    Since

    3.2

    Declaration

    Objective-C

    - (id<EMSecureString>)totpWithAuthInput:(id<EMAuthInput>)authInput
                                      error:(NSError **)error;

    Swift

    func totp(with authInput: (any EMAuthInput)!) throws -> any EMSecureString

    Parameters

    authInput

    The authInput.

    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 OTP.

  • Creates an event based OCRA C/R as defined by the Gemalto OATH eBanking options.

    Warning

    Depending of the EMAuthInput type you are using, you may have to use this function asynchronously, please - see: EMAuthInput for more details

    Since

    3.2

    Declaration

    Objective-C

    - (id<EMSecureString>)
        ocraEventChallengeResponseWithAuthInput:(id<EMAuthInput>)authInput
                              challengeQuestion:
                                  (id<EMSecureString>)challengeQuestion
                                          error:(NSError **)error;

    Swift

    func ocraEventChallengeResponse(with authInput: (any EMAuthInput)!, challengeQuestion: (any EMSecureString)!) throws -> any EMSecureString

    Parameters

    authInput

    The authInput.

    challengeQuestion

    The challenge question.

    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. @exception NSInternalInconsistencyException when the associated token has the EMTokenCapabilityDUAL_SEED capability since only time based algorithms are supported for this capability. See EMTokenCapability.

    Return Value

    The OTP.

  • Creates a time based OCRA C/R as defined by the Gemalto OATH eBanking options.

    Warning

    Depending of the EMAuthInput type you are using, you may have to use this function asynchronously, please - see: EMAuthInput for more details

    Since

    3.2

    Declaration

    Objective-C

    - (id<EMSecureString>)
        ocraTimeChallengeResponseWithAuthInput:(id<EMAuthInput>)authInput
                             challengeQuestion:(id<EMSecureString>)challengeQuestion
                                         error:(NSError **)error;

    Swift

    func ocraTimeChallengeResponse(with authInput: (any EMAuthInput)!, challengeQuestion: (any EMSecureString)!) throws -> any EMSecureString

    Parameters

    authInput

    The authInput.

    challengeQuestion

    The challenge question.

    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 OTP.

  • Creates an event based OCRA signature as defined by the Gemalto OATH eBanking options.

    Warning

    Depending of the EMAuthInput type you are using, you may have to use this function asynchronously, please - see: EMAuthInput for more details

    Since

    3.2

    Declaration

    Objective-C

    - (id<EMSecureString>)ocraEventSignatureWithAuthInput:(id<EMAuthInput>)authInput
                                               dataToSign:(NSArray *)dataToSign
                                                    error:(NSError **)error;

    Swift

    func ocraEventSignature(with authInput: (any EMAuthInput)!, dataToSign: [Any]!) throws -> any EMSecureString

    Parameters

    authInput

    The authInput.

    dataToSign

    The data to sign (as an array of EMSecureString instances). dataToSign must not contain a ‘~’ (0x7E) byte value.

    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. @exception NSInternalInconsistencyException when the associated token has the EMTokenCapabilityDUAL_SEED capability since only time based algorithms are supported for this capability. See EMTokenCapability.

    Return Value

    The OTP.

  • Creates a time based OCRA signature as defined by the Gemalto OATH eBanking options.

    Warning

    Depending of the EMAuthInput type you are using, you may have to use this function asynchronously, please - see: EMAuthInput for more details

    Since

    3.2

    Declaration

    Objective-C

    - (id<EMSecureString>)ocraTimeSignatureWithAuthInput:(id<EMAuthInput>)authInput
                                              dataToSign:(NSArray *)dataToSign
                                                   error:(NSError **)error;

    Swift

    func ocraTimeSignature(with authInput: (any EMAuthInput)!, dataToSign: [Any]!) throws -> any EMSecureString

    Parameters

    authInput

    The authInput.

    dataToSign

    The data to sign (as an array of EMSecureString instances). dataToSign must not contain a ‘~’ (0x7E) byte value.

    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 OTP.

  • Return lifespan of the last OTP computed by this device.

    • In case last OTP computed with this device is time-based
      • If positive, the last OTP is still valid according current time and device’s timestep settings. The returned value indicates the remaining seconds before the OTP becomes obsolete.
      • If negative, the last OTP computed is obsolete. The absolute value indicates the time elapsed since the OTP has become obsolete.
    • In case last OTP computed with this device is event-based, or no OTP has been computed yet, the function returns NSIntegerMax.

    Since

    2.3

    The following example illustrates the usage.

      // Create OATH settings (see EMOathFactory)
     id<EMMutableSoftGemaltoOathSettings> oathSettings = ...
    
     // Create a OATH device (see EMOathFactory)
     id<EMGemaltoOathDevice> device = ...
    
     // Compute a time-based OTP with device (with pin and challengeQuestion EMSecureString)
     [device ocraTimeChallengeResponseWithPin:pin challengeQuestion:challengeQuestion];
    
     // Each time selector [... lastOtpLifespan] is called, it returns the
     // remaining lifespan in seconds of the last time-based OTP. Lifespan is
     // computed with respect of device's settings (in this example it returns
     // the lifespan according to Gemalto device fixed settings, i.e. 30-seconds timestep).
     NSInteger lifespan = [device lastOtpLifespan];
    

    Declaration

    Objective-C

    - (NSInteger)lastOtpLifespan;

    Swift

    func lastOtpLifespan() -> Int

    Return Value

    lifespan