Latest 0.1.6
Homepage https://github.com/chrisamanse/OTPKit
License MIT
Platforms ios 9.0, osx 10.10, watchos 2.0, tvos 10, requires ARC
Dependencies CryptoKit
Authors

Build Status
Swift Version
Carthage compatible
spm compatible
CocoaPods compatible
Platform

OTPKit is a Swift framework containing implementations of one-time password algorithms.

Supported Algorithms

Usage

Generating a time-based one-time password


// Shared unique secret (usually represented by a Base 32 string)
let base32String = "V3ZMBGAETLLSXRJZ6QZD42Z33O3DK3R7"

let secret = try! Base32.decode(base32String)

let passwordGenerator = TOTPGenerator(key: secret, period: 30, digits: 6, hashFunction: .sha1)

let now = Date()
try? passwordGenerator.password(for: now) // Password for current time
try? passwordGenerator.password(for: now + 30) // Password for 30 seconds from now

License

Copyright (c) 2016 Joe Christopher Paul Amanse

This software is distributed under the MIT License.

Latest podspec

{
    "name": "OTPKit",
    "version": "0.1.6",
    "summary": "Pure Swift implementations of one-time password algorithms.",
    "description": "OTPKit is a Swift framework containing implementations of one-time password algorithms.",
    "homepage": "https://github.com/chrisamanse/OTPKit",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Chris Amanse": "[email protected]"
    },
    "social_media_url": "http://twitter.com/ChrisAmanse",
    "platforms": {
        "ios": "9.0",
        "osx": "10.10",
        "watchos": "2.0",
        "tvos": "10"
    },
    "source": {
        "git": "https://github.com/chrisamanse/OTPKit.git",
        "tag": "0.1.6"
    },
    "source_files": [
        "Sources",
        "Sources/**/*.{h,swift}"
    ],
    "requires_arc": true,
    "pod_target_xcconfig": {
        "SWIFT_VERSION": "3.0"
    },
    "dependencies": {
        "CryptoKit": [
            "~> 0"
        ]
    },
    "pushed_with_swift_version": "3.0"
}

Pin It on Pinterest

Share This