How maxgoedjen/secretive works
Based on our analysis of the file tree and README, Secretive is an application designed for securely storing and managing SSH keys using macOS’ Secure Enclave (or, alternatively, a Smart Card on older Macs). The project is implemented in Swift and comprises both the native management app (the UI and control logic) and several internal libraries (Swift packages) that encapsulate the core security and key-management functionality.
Project Type and Purpose
• This is a native macOS application built in Swift. Its primary purpose is to securely store and manage SSH keys by leveraging the Secure Enclave and Keychain APIs.
• The README also mentions Touch ID (or Apple Watch) authentication, notifications for key access, and support for Smart Cards.
• Key indicators: “Secretive” is a management app, and the directory structure under Sources/Packages shows multiple libraries (the “SecretAgentKit”, “SecretKit”, “SecureEnclaveSecretKit”, and “SmartCardSecretKit”) that provide modular functionality.
Analyzing the File Structure
• Top-level directories:
• .github: Contains CI/CD configuration (workflows for build, test, release), indicating an auditable build and release process.
• Sources: Contains the bulk of the source code, broken down into distinct modules:
◦ Sources/Secretive: The primary application. This directory contains the main app entry point (App.swift), views (SwiftUI components, e.g., ContentView, SetupView), controllers/logic, and configuration files.
◦ Sources/SecretAgent: Likely a helper application or background “agent” that might manage system-level interactions (for example, communicating with Keychain or handling notifications).
◦ Sources/Packages: Contains multiple Swift packages which are the reusable libraries forming the core of secret handling. Each package (e.g., SecretAgentKit, SecretKit, SecureEnclaveSecretKit, SmartCardSecretKit) encapsulates a part of the functionality (communication with OS-level secure hardware, key operations, protocol interfaces, and so on).
◦ Sources/Config and various configuration files (e.g., .xcconfig, project.pbxproj) indicate a careful separation of environment and build settings.