EMPropertyStorage
Objective-C
@protocol EMPropertyStorage <NSObject>
Swift
protocol EMPropertyStorage : NSObjectProtocol
Interface of the secure storage object. See EMSecureStorageManager to query secure storage objects.
Note:
Before calling any method of EMPropertyStorage, make sure you have already logged in to password manager first. See EMPasswordManager.
Since
3.1-
Opens a storage. This has to be called before retrieving or updating the data in the storage.
Since
3.1
Declaration
Objective-C
- (BOOL)open:(NSError **)anError;Swift
func open() throwsParameters
anErrorIf an error occurs, upon return contains an NSError object that describes the problem. If you are not interested in possible errors, you may pass in
NULL.Return Value
YESif opening succeeds,NOotherwise. -
Closes a storage.
Since
3.1
Declaration
Objective-C
- (BOOL)close:(NSError **)anError;Swift
func close() throwsParameters
anErrorIf an error occurs, upon return contains an NSError object that describes the problem. If you are not interested in possible errors, you may pass in
NULL.Return Value
YESif closing succeeds,NOotherwise. -
Checks if the storage is open.
Since
3.1
Declaration
Objective-C
- (BOOL)isOpen;Swift
func isOpen() -> BoolReturn Value
YESif open,NOotherwise. -
Gets the set of keys for all the data stored in the storage.
Since
3.1
Declaration
Objective-C
- (NSSet *)allKeys:(NSError **)anError;Swift
func allKeys() throws -> Set<AnyHashable>Parameters
anErrorIf an error occurs, upon return contains an NSError object that describes the problem. If you are not interested in possible errors, you may pass in
NULL.Return Value
Set of keys in the secure storage; an empty set if contains no key-value;
nilif an error occurs. -
Check if an entry with the given key exist in the storage.
Since
3.1
Declaration
Objective-C
- (BOOL)hasPropertyWithKey:(NSData *)key error:(NSError **)anError;Swift
func hasProperty(withKey key: Data!) throwsParameters
keythe identifier of a property.
anErrorIf an error occurs, upon return contains an NSError object that describes the problem. If you are not interested in possible errors, you may pass in
NULL.Return Value
YESif property exists,NOif not exist or some error occurred. -
Sets a property into the storage.
Since
3.1
Declaration
Objective-C
- (BOOL)setProperty:(id<EMSecureByteArray>)property forKey:(NSData *)key wipeValue:(BOOL)wipeValue error:(NSError **)anError;Swift
func setProperty(_ property: (any EMSecureByteArray)!, forKey key: Data!, wipeValue: Bool) throwsParameters
keyThe key. Should not be
nil.propertyThe property value. Should not be
nil.wipeValueIf
YESimmediately wipes the property value after calling the method.anErrorIf an error occurs, upon return contains an NSError object that describes the problem. If you are not interested in possible errors, you may pass in
NULL.Return Value
YESif stored successfully,NOotherwise. -
Gets property from the storage.
Since
3.1
Declaration
Objective-C
- (id<EMSecureByteArray>)propertyForKey:(NSData *)key error:(NSError **)anError;Swift
func property(forKey key: Data!) throws -> any EMSecureByteArrayParameters
keyThe key. Should not be
nil.anErrorIf an error occurs, upon return contains an NSError object that describes the problem. If you are not interested in possible errors, you may pass in
NULL.Return Value
The property if found,
nilif not found or if an error occurs. -
Removes a property with given key.
Since
3.1
Declaration
Objective-C
- (BOOL)removePropertyForKey:(NSData *)key error:(NSError **)anError;Swift
func removeProperty(forKey key: Data!) throwsParameters
keyThe key. Should not be
nil.anErrorIf an error occurs, upon return contains an NSError object that describes the problem. If you are not interested in possible errors, you may pass in
NULL.Return Value
YESif deleted successfully,NOotherwise. -
Removes all the properties from the storage. Results in empty storage but the storage table still exists.
Since
3.1
Declaration
Objective-C
- (BOOL)removeAllProperties:(NSError **)anError;Swift
func removeAllProperties() throwsParameters
anErrorIf an error occurs, upon return contains an NSError object that describes the problem. If you are not interested in possible errors, you may pass in
NULL.Return Value
YESif deleted successfully,NOotherwise.
EMPropertyStorage Protocol Reference