Skip to content
This repository has been archived by the owner on Aug 4, 2019. It is now read-only.

Latest commit

 

History

History
35 lines (27 loc) · 941 Bytes

README.md

File metadata and controls

35 lines (27 loc) · 941 Bytes

oath.swift

OATH algorithms in swift

Features

  • TOTP
  • HOTP
  • Challenge and response

Installation

CocoaPods

CocoaPods is a dependency manager for Cocoa projects. For usage and installation instructions, visit their website. To integrate oath.swift into your Xcode project using CocoaPods, specify it in your Podfile:

Swift 4.2

pod 'oath', :git => 'https://github.com/Carrene/oath.swift.git', :tag => '0.4.0'

Swift 3

pod 'oath', :git => 'https://github.com/Carrene/oath.swift.git', :tag => '0.3.0'

Usage

//TOTP
let otp = Totp(secret: secret, timeInterval: 30, otpLength: 8, hashType: HashType.SHA1)
let totp = otp.generateTotp(time: 59)

//HOTP
let hotp = Hotp(secret: secret, otpLength: 6, hashType: HashType.SHA1)
let hotp = hotp.generateHotp()

For more information consider oath.swift tests