https://github.com/tinfoilanalytics/verifier-swift-example
- In Xcode, select File > Add Package Dependencies
- Enter the package repository URL:
https://github.com/tinfoilanalytics/verifier-swift
- Select the version you want to use
- Click "Add Package"
Alternatively, you can add it directly to your Package.swift
file:
dependencies: [
.package(url: "https://github.com/tinfoilanalytics/verifier-swift", exact: "0.0.2")
]
First, import the TinfoilVerifier package in your Swift file:
import TinfoilVerifier
To create a new verifier client:
let client = TinfoilVerifier.ClientNewSecureClient(
"inference-enclave.tinfoil.sh", // Enclave hostname
"tinfoilanalytics/nitro-enclave-build-demo" // Repository path
)
To verify an enclave:
do {
let enclaveState = try client?.verify()
// Access EIF hash and TLS certificate fingerprint
let eifHash = enclaveState?.eifHash
let certFingerprint = enclaveState?.certFingerprint
} catch {
print("Verification failed: \(error)")
}
Creates a new secure client for verifying enclaves.
Parameters:
serverAddress
: String - The address of the enclave serverprojectPath
: String - The path to the project repository
Returns: An optional TinfoilVerifier client instance
Performs verification of the enclave.
Returns: An EnclaveState object containing:
eifHash
: String - The EIF hash of the enclavecertFingerprint
: [UInt8]? - The certificate fingerprint as a byte array
Throws: Verification error