     */
     public var rawValue: CFString {
         switch self {
-        case .WhenUnlocked:
+        case .whenUnlocked:
             return kSecAttrAccessibleWhenUnlocked
-        case .AfterFirstUnlock:
+        case .afterFirstUnlock:
             return kSecAttrAccessibleAfterFirstUnlock
-        case .Always:
+        case .always:
             return kSecAttrAccessibleAlways
-        case .WhenUnlockedThisDeviceOnly:
+        case .whenUnlockedThisDeviceOnly:
             return kSecAttrAccessibleWhenUnlockedThisDeviceOnly
-        case .AfterFirstUnlockThisDeviceOnly:
+        case .afterFirstUnlockThisDeviceOnly:
             return kSecAttrAccessibleAfterFirstUnlockThisDeviceOnly
-        case .AlwaysThisDeviceOnly:
+        case .alwaysThisDeviceOnly:
             return kSecAttrAccessibleAlwaysThisDeviceOnly
         }
     }

    /**
    Retreives the data for a given key, or returns nil.
    */
    public func dataForKey(key: String) -> NSData? {
        var query = baseQuery(forKey: key)
        query[kSecMatchLimit as String] = kSecMatchLimitOne as String
        query[kSecReturnData as String] = true

        var dataRef: CFTypeRef?
        let status = SecItemCopyMatching(query as CFDictionaryRef, &dataRef)
        if status != errSecSuccess && status != errSecItemNotFound {
            print("Latch failed to retrieve data for key '\(key)', error: \(status)")
        }

        return dataRef as? NSData
    }

    /**
    Retreives the string value for a given key. It will return nil if the data
    is not a UTF8 encoded string.
    */
    public func stringForKey(key: String) -> String? {
        guard let data = dataForKey(key) else { return nil }
        return NSString(data: data, encoding: NSUTF8StringEncoding) as? String
    }

    // MARK - Setters

    /**
    Set an NSCoding compliant object for a given key.
    */
    @discardableResult public func set(object: NSCoding, forKey key: String) -> Bool {
        let data = NSKeyedArchiver.archivedData(withRootObject: object)
        return set(object: data, forKey: key)
    }

    /**
    Set an NSData blob for a given key.
    */
    @discardableResult public func set(object: Data, forKey key: String) -> Bool {
        var query = baseQuery(forKey: key)

        var update = [NSString : AnyObject]()
        update[kSecValueData] = object as AnyObject?
        update[kSecAttrAccessible] = state.accessibility.rawValue

        var status = errSecSuccess
        if data(forKey: key) != nil { // Data already exists, we're updating not writing.
            status = SecItemUpdate(query as CFDictionary, update as CFDictionary)
        }
        else { // No existing data, write a new item.
            for (key, value) in update {
                query[key] = value
            }

            status = SecItemAdd(query as CFDictionary, nil)
        }

        if status != errSecSuccess {
