标签:ios sskeychain
SSKeychain 这个库是对iOS安全框架的封装,使用起来极其简单。
git:https://github.com/samsoffes/sskeychain
这里贴下使用代码:
- (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view, typically from a nib. [SSKeychain setPassword:@"123" forService:@"com.service.service" account:@"account"]; NSString *password = [SSKeychain passwordForService:@"com.service.service" account:@"account"]; NSLog(@"password = %@",password); // Getting Accounts NSArray *accounts = [SSKeychain allAccounts]; NSLog(@"accounts = %@",accounts); accounts = [SSKeychain accountsForService:@"com.service.service"]; NSLog(@"accounts = %@",accounts); // Deleting Passwords [SSKeychain deletePasswordForService:@"com.service.service" account:@"account"]; password = [SSKeychain passwordForService:@"com.service.service" account:@"account"]; NSLog(@"password = %@",password); }代码下载:http://download.csdn.net/detail/qqmcy/8520719
标签:ios sskeychain
原文地址:http://blog.csdn.net/qqmcy/article/details/44516011