 }
 
 extension Accessibility : RawRepresentable, Printable {
-    public static let allValues: [Accessibility] = [
-        WhenUnlocked,
-        AfterFirstUnlock,
-        Always,
-        WhenPasscodeSetThisDeviceOnly,
-        WhenUnlockedThisDeviceOnly,
-        AfterFirstUnlockThisDeviceOnly,
-        AlwaysThisDeviceOnly,
-    ]
     
     public init?(rawValue: String) {
-        if rawValue == kSecAttrAccessibleWhenUnlocked {
+        switch rawValue {
+        case kSecAttrAccessibleWhenUnlocked:
             self = WhenUnlocked
-        } else if rawValue == kSecAttrAccessibleAfterFirstUnlock {
+        case kSecAttrAccessibleAfterFirstUnlock:
             self = AfterFirstUnlock
-        } else if rawValue == kSecAttrAccessibleAlways {
+        case kSecAttrAccessibleAlways:
             self = Always
-        } else if rawValue == kSecAttrAccessibleWhenPasscodeSetThisDeviceOnly {
+        case kSecAttrAccessibleWhenPasscodeSetThisDeviceOnly:
             self = WhenPasscodeSetThisDeviceOnly
-        } else if rawValue == kSecAttrAccessibleWhenUnlockedThisDeviceOnly {
+        case kSecAttrAccessibleWhenUnlockedThisDeviceOnly:
             self = WhenUnlockedThisDeviceOnly
-        }  else if rawValue == kSecAttrAccessibleAfterFirstUnlockThisDeviceOnly {
+        case kSecAttrAccessibleAfterFirstUnlockThisDeviceOnly:
             self = AfterFirstUnlockThisDeviceOnly
-        } else if rawValue == kSecAttrAccessibleAlwaysThisDeviceOnly {
+        case kSecAttrAccessibleAlwaysThisDeviceOnly:
             self = AlwaysThisDeviceOnly
-        } else {
+        default:
             return nil
         }
     }

}

extension AuthenticationType : RawRepresentable, Printable {
    public static let allValues: [AuthenticationType] = [
        NTLM,
        MSN,
        DPA,
        RPA,
        HTTPBasic,
        HTTPDigest,
        HTMLForm,
        Default,
    ]
    
    public init?(rawValue: String) {
        if rawValue == kSecAttrAuthenticationTypeNTLM {
            self = NTLM
        } else if rawValue == kSecAttrAuthenticationTypeMSN {
            self = MSN
        } else if rawValue == kSecAttrAuthenticationTypeDPA {
            self = DPA
        } else if rawValue == kSecAttrAuthenticationTypeRPA {
            self = RPA
        } else if rawValue == kSecAttrAuthenticationTypeHTTPBasic {
            self = HTTPBasic
        }  else if rawValue == kSecAttrAuthenticationTypeHTTPDigest {
            self = HTTPDigest
        } else if rawValue == kSecAttrAuthenticationTypeHTMLForm {
            self = HTMLForm
        } else if rawValue == kSecAttrAuthenticationTypeDefault {
            self = Default
        } else {
            return nil
        }
    }

            if let data = result as NSData? {
                return FailableOf(data)
            }
            return FailableOf(securityError(status: Status.UnexpectedError.rawValue))
        case errSecItemNotFound:
            return FailableOf(nil)
        default: ()
