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

Carrene/oath.swift

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published