Swift SDK
The Fyno TOTP SDK for iOS provides secure Time-based One-Time Password (TOTP) generation and tenant management. It supports tenant enrollment, secure secret storage using the iOS Keychain, configurable TOTP parameters, and OTP generation compliant with RFC 6238.
Module Name:
FynoTOTP
Minimum iOS Version: iOS 13
Target iOS Version: iOS 16+
Language: Swift
Table of Contents
- Installation
- Core Components
- API Reference
- Usage Examples
- Data Models
- Error Handling
- Security Considerations
Installation
CocoaPods
Add the dependency to your Podfile:
Then run:
Core Components
FynoTOTP Class
The main entry point for all SDK operations.
Responsibilities:
- SDK initialization
- Tenant registration and revocation
- Secure secret storage using Keychain
- TOTP generation
Initializer:
API Reference
initFynoConfig
Initializes the SDK with workspace and user identifiers.
registerTenant
Registers a tenant and securely stores the TOTP secret.
setConfig
Sets the TOTP configuration for a tenant.
getTotp
Generates and retrieves the current TOTP code.
deleteTenantData
Deletes all tenant data and the stored secret.
Data Models
TotpConfig
Error Handling
FynoError
Security Considerations
- Secrets stored in iOS Keychain
- RFC 6238 compliant TOTP generation
- HMAC SHA1 / SHA256 / SHA512 support
Changelog
Version 1.0.0
- Initial iOS TOTP release