Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save inorganik/f9971e65f71e037650b39b5f182e157e to your computer and use it in GitHub Desktop.
Save inorganik/f9971e65f71e037650b39b5f182e157e to your computer and use it in GitHub Desktop.
iOS Keychain status to string
+ (NSString *)keychainStatusToString:(OSStatus)status {
switch (status) {
case 0:
return @"Success";
case -4:
return @"Function or operation not implemented.";
case -50:
return @"One or more parameters passed to the function were not valid.";
case -108:
return @"Failed to allocate memory.";
case -2000:
return @"Username or servicename nil";
case -25291:
return @"No trust results are available.";
case -25293:
return @"Authorization/Authentication failed.";
case -25299:
return @"The item already exists.";
case -25300:
return @"The item cannot be found.";
case -25308:
return @"Interaction with the Security Server is not allowed.";
case -26275:
return @"Unable to decode the provided data.";
default:
return [NSString stringWithFormat:@"Unknown error: %d", (int)status];
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment