测试已测试 | ✓ |
Lang语言 | Obj-CObjective C |
许可证 | MIT |
发布最后发布 | 2015年2月 |
由 Felipe Cavalcanti 维护。
依赖项 | |
RNCryptor | >= 0 |
GZIP | >= 0 |
针对 iOS 的安全简单的键值存储
Owl 使用
Owl 提供
pod 'Owl'
#import "Owl.h"
[Owl putObject:object withKey:@"key"];
T * object = [Owl getObjectWithKey:@"key"];
[Owl removeObjectWithKey:@"key"]
BOOL ret = [Owl containsKey:@"key"];
[Owl putObject:[NSArray arrayWithObjects:object1, object2,...] withKey:@"a"]; //save array
[Owl putObject:@"Hello" withKey:@"b"]; //save string
[Owl putObject:[NSNumber numberWithInt:1] withKey:@"c"]; //save number
[Owl putObject:[[Foo alloc] init] withKey:@"d"]; //save an object
NSArray * value = [Owl getObjectWithKey:@"a"]; //load array
NSString * value = [Owl getObjectWithKey:@"b"]; //load string
NSNumber * value = [Owl getObjectWithKey:@"c"]; //load number
Foo * value = [Owl getObjectWithKey:@"d"]; //load an object
Owl 在保存数据时会使用 AES 加密以安全地保存,所有安全方法都是用纯 C 编写的,这使得拦截/破解它们更加困难。
Owl 可以持久化 任何子类为 NSObject 的对象,假设该对象的所有属性也都是或为原语。您应该仅避免使用未通过 NSValue 符合 NSCoding 的结构体。
Copyright (c) 2015 Felipe Cavalcanti Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.