码迷,mamicode.com
首页 > 移动开发 > 详细

iOS 轻量级安全第三方库 SSKeychain

时间:2015-03-21 15:35:28      阅读:845      评论:0      收藏:0      [点我收藏+]

标签: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

标签:ios   sskeychain   

原文地址:http://blog.csdn.net/qqmcy/article/details/44516011

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!