標籤: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