Public Methods

configure

Configures the Keyless mobile API.
Throws KeylessError.initializationFailure if the initialisation of the SDK failed.
Declaration public static func configure(apiKey: String, delegate: KeylessDelegateProtocol, numberOfLivenessChallenges: UInt = defaultLivenessChallenges) throws
Paramaters
apiKey
The Keyless API key.
delegate
An instance implementing the KeylessDelegateProtocol to receive updates on the enrollment.
numberOfLivenessChallenges
0 enables passive liveness detection. No other value is currently supported.

getStatus

Configures the Keyless mobile API.
Declaration public func getStatus() -> KeylessStatus

enrollCustomToken

Enrolls the user in custom token mode.
This method performs the enrollment of the user to Keyless and proceeds in two steps.
  1. 1.
    It shows a modal view controller on top of the current view controller, which assists the user while scanning their biometric template.
  2. 2.
    It dismisses the modal view controller. Control goes back to the caller.
When this method returns, enrollment is not yet completed, and continues in the background. As background enrollment progresses, this method informs the delegate by calling the method KeylessDelegateProtocol.enrollmentDidProgress(...). Once the enrollment completes successfully, this method invokes KeylessDelegateProtocol.enrollmentDidFinish(...). If enrollment fails, this method invokes KeylessDelegateProtocol.enrollmentDidFinish(...).
This method requires the caller to provide a custom token that is securely stored using the Keyless network, and can later be retrieved.
Precondition The user is not enrolled (Keyless.getStatus() returns KeylessStatus.notEnrolled)
Postcondition The user is enrolled in custom token mode (Keyless.getStatus() returns KeylessStatus.enrolledCustomToken).
Throws KeylessError.wrongStatus if the precondition is not met
Declaration public func enrollCustomToken(with customToken: String) throws
Paramaters
customToken
A UTF-8 printable string. If the string contains non-printable characters, the behaviour is undefined.

getCustomAuthenticationToken

Authenticates the user and returns the custom authentication token.
This method authenticates the user by showing a modal view controller on top of the current view controller. The modal view controller assists the user in scanning their biometric template.
Precondition The user is enrolled in legacy mode (Keyless.getStatus() returns KeylessStatus.enrolledCustomToken).
Throws KeylessError.wrongStatus if the precondition is not met.
Declaration public func getCustomAuthenticationToken() throws

deEnroll

De-enrolls the user.
This method permanently de-enrolls the user and deletes all the associated information stored in the Keyless nodes.
Precondition The Keyless object is in the enrolled (Keyless.getStatus() returns KeylessStatus.enrolled(...) or KeylessStatus.enrolledCustomToken
Postcondition The Keyless object is not enrolled (Keyless.getStatus() returns KeylessStatus.notEnrolled).
Throws KeylessError.deEnrollmentFailed(...) on failure or KeylessError.wrongStatus if the precondition is not met.
Declaration public func deEnroll(deEnrollmentChallenge: String?) throws
Paramaters
deEnrollmentChallenge
An optional string provided by the Keyless Challenge/Response API used to verify successful completion of user deEnrollment (only relewant when Keyless.getStatus() returns KeylessStatus.enrolled(...)). It is structured as the message parameter of the Keyless.getAuthenticationToken(...) method.

retrieveDataForBackup

Retrieves the current backup data and backup key if no error occurred.
Throws KeylessError.wrongStatus if the precondition is not met.
Returns Two strings containing the (1) backup data and (2) backup key as a tuple.
Declaration public func retrieveDataForBackup() throws -> (backupData: String, backupKey: String)

enrollFromBackup

Enrolls the user from a backup.
This method performs the enrollment of the user to Keyless by passing the backup data and a backup key.
When this method returns, enrollment from backup is completed. When the enrollment from backup completes successfully, this method invokes KeylessDelegateProtocol.enrollmentDidFinish(...). If enrollment fails, this method invokes KeylessDelegateProtocol.enrollmentDidFinish(...).
Precondition The user is not enrolled (Keyless.getStatus() returns KeylessStatus.notEnrolled)
Postcondition The user is enrolled in custom token mode (Keyless.getStatus() returns KeylessStatus.enrolledCustomToken).
Throws KeylessError.wrongStatus if the precondition is not met
Declaration public func enrollFromBackup(backupData: String, backupKey: String) throws
Paramaters
backupData
A required string representing the backup data.
backupKey
A required string representing the backup key.

enroll

Deprecated. Use: Keyless.enrollCustomToken(...)
‌Enrolls the user.
This method performs the enrollment of the user to Keyless and proceeds in two steps.
  1. 1.
    It shows a modal view controller on top of the current view controller, which assists the user while scanning their biometric template.
  2. 2.
    It dismisses the modal view controller. Control goes back to the caller.
When this method returns, enrollment is not yet completed, and continues in the background. As background enrollment progresses, this method informs the delegate by calling the method KeylessDelegateProtocol.enrollmentDidProgress(...). Once the enrollment completes successfully, this method invokes KeylessDelegateProtocol.enrollmentDidFinish(...). If enrollment fails, this method invokes KeylessDelegateProtocol.enrollmentDidFinish(...).
Precondition The user is not enrolled (Keyless.getStatus() returns KeylessStatus.notEnrolled).
Postcondition The user is enrolled (Keyless.getStatus() returns KeylessStatus.enrolled(...)).
Throws KeylessError.wrongStatus if the precondition is not met.
Declaration @available(*, deprecated, message: "Legacy mode will be removed in a future version of the SDK. Please transition to custom mode.") public func enroll(enrollmentChallenge: String?) throwspublic func enroll(enrollmentChallenge: String?) throws
Parameters
enrollmentChallenge
An optional string provided by the Keyless Challenge/Response API used to verify successful completion of user enrollment. It is structured as the message parameter of the Keyless.getAuthenticationToken(...) method

getAuthenticationToken

Authenticates the user and returns an authentication token.
This method authenticates the user by showing a modal view controller on top of the current view controller. The modal view controller assists the user in scanning their biometric template.
Precondition The user is enrolled (Keyless.getStatus() returns KeylessStatus.enrolled(...)).
Throws KeylessError.wrongStatus if the precondition is not met.
Declaration @available(*, deprecated, message: "Legacy mode will be removed in a future version of the SDK. Please transition to custom mode.") public func getAuthenticationToken(message: String) throws
Parameters
message
A server request provided by the Keyless Challenge/Response API that becomes cryptographically bound to the authentication token. It is a structured JSON with keys:
Export as PDF
Copy link
Outline
configure
getStatus
enrollCustomToken
getCustomAuthenticationToken
deEnroll
retrieveDataForBackup
enrollFromBackup
enroll
getAuthenticationToken