C# Class Plugin.SecureStorage.WinSecureStorageBase

Base class for handling in memory operation for windows platform The derived classes must take care of persisting the information
Inheritance: Plugin.SecureStorage.Abstractions.SecureStorageImplementationBase
显示文件 Open project: sameerkapps/SecureStorage

Public Properties

Property Type Description
StorageFile string
StoragePassword string

Protected Properties

Property Type Description
StoragePasswordArray byte[]

Public Methods

Method Description
DeleteKey ( string key ) : bool

Deletes the key and corresponding value from the storage

GetValue ( string key, string defaultValue = null ) : string

Retrieves the value from storage. If value with the given key does not exist, returns default value

HasKey ( string key ) : bool

Determines whether specified key exists in the storage

SetValue ( string key, string value ) : bool

Sets the value for the given key. If value exists, overwrites it Else creates new entry. Does not accept null value.

Protected Methods

Method Description
LoadData ( ) : byte[]

Derived classes must implement this method. Derived class will read the data from the storage, decrypt it and return clear data.

SaveData ( byte data ) : void

Derived classes must implement this method. Derived class will encrypt the data and save it.

WinSecureStorageBase ( ) : System

Default constructor, validates settings, loads the store

Private Methods

Method Description
LoadFromStorage ( ) : void

Loads the dictionary from storge

SaveToStorage ( ) : void

method to encrypt and save dictionary to storage

Method Details

DeleteKey() public method

Deletes the key and corresponding value from the storage
public DeleteKey ( string key ) : bool
key string Key.
return bool

GetValue() public method

Retrieves the value from storage. If value with the given key does not exist, returns default value
public GetValue ( string key, string defaultValue = null ) : string
key string Key.
defaultValue string Default value.
return string

HasKey() public method

Determines whether specified key exists in the storage
public HasKey ( string key ) : bool
key string Key.
return bool

LoadData() protected abstract method

Derived classes must implement this method. Derived class will read the data from the storage, decrypt it and return clear data.
protected abstract LoadData ( ) : byte[]
return byte[]

SaveData() protected abstract method

Derived classes must implement this method. Derived class will encrypt the data and save it.
protected abstract SaveData ( byte data ) : void
data byte Unencrypted data
return void

SetValue() public method

Sets the value for the given key. If value exists, overwrites it Else creates new entry. Does not accept null value.
public SetValue ( string key, string value ) : bool
key string Key.
value string Value.
return bool

WinSecureStorageBase() protected method

Default constructor, validates settings, loads the store
protected WinSecureStorageBase ( ) : System
return System

Property Details

StorageFile public_oe static_oe property

Name of the storage file.
public static string StorageFile
return string

StoragePassword public_oe static_oe property

Password for storage. Must be set prior to usage in Android and Windows
public static string StoragePassword
return string

StoragePasswordArray protected_oe property

array corresponding to the password
protected byte[] StoragePasswordArray
return byte[]