         }
     }
 
-    func optionalForKey<A>(key: String) throws -> A? {
+    public func optionalForKey<A>(key: String) throws -> A? {
         do {
             let a: A = try valueForKey(key)
             return a

import Foundation


struct Keychain {

    enum Error: ErrorType {
        case NoValueForKey(String)
        case TypeMismatch(String)
        case KeychainError(String, OSStatus)
    }

    func valueForKey<A>(key: String) throws -> A {
        let query = [
            kSecClass as String       : kSecClassGenericPassword,
            kSecAttrAccount as String : key,

//
//  Keychain.swift
//  SimpleKeychain
//
//  Created by Tim Shadel on 11/10/15.
//  Copyright © 2016 OC Tanner. All rights reserved.
