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() throws

    Parameters

    anError

    If 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

    YES if opening succeeds, NO otherwise.

  • Closes a storage.

    Since

    3.1

    Declaration

    Objective-C

    - (BOOL)close:(NSError **)anError;

    Swift

    func close() throws

    Parameters

    anError

    If 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

    YES if closing succeeds, NO otherwise.

  • Checks if the storage is open.

    Since

    3.1

    Declaration

    Objective-C

    - (BOOL)isOpen;

    Swift

    func isOpen() -> Bool

    Return Value

    YES if open, NO otherwise.

  • 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

    anError

    If 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; nil if 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!) throws

    Parameters

    key

    the identifier of a property.

    anError

    If 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

    YES if property exists, NO if 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) throws

    Parameters

    key

    The key. Should not be nil.

    property

    The property value. Should not be nil.

    wipeValue

    If YES immediately wipes the property value after calling the method.

    anError

    If 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

    YES if stored successfully, NO otherwise.

  • 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 EMSecureByteArray

    Parameters

    key

    The key. Should not be nil.

    anError

    If 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, nil if 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!) throws

    Parameters

    key

    The key. Should not be nil.

    anError

    If 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

    YES if deleted successfully, NO otherwise.

  • 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() throws

    Parameters

    anError

    If 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

    YES if deleted successfully, NO otherwise.