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

// MARK:

extension ItemClass : RawRepresentable, Printable {
    public static let allValues: [ItemClass] = [GenericPassword, InternetPassword]
    
    public init?(rawValue: String) {
        if rawValue == kSecClassGenericPassword {
            self = GenericPassword
        } else if rawValue == kSecClassInternetPassword {
            self = InternetPassword
        } else {
            return nil
        }
    }

            return "The new owner is not valid."
        case InvalidModifyMode:
            return "The modify mode is not valid. }"
        default:
            return "Unexpected error has occurred."
        }
    }
}
