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

郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。