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
Afficher le fichier Open project: sameerkapps/SecureStorage

Méthodes publiques

Свойство Type Description
StorageFile string
StoragePassword string

Protected Properties

Свойство Type Description
StoragePasswordArray byte[]

Méthodes publiques

Méthode 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.

Méthodes protégées

Méthode 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

Méthode Description
LoadFromStorage ( ) : void

Loads the dictionary from storge

SaveToStorage ( ) : void

method to encrypt and save dictionary to storage

Method Details

DeleteKey() public méthode

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

GetValue() public méthode

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.
Résultat string

HasKey() public méthode

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

LoadData() protected abstract méthode

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[]
Résultat byte[]

SaveData() protected abstract méthode

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
Résultat void

SetValue() public méthode

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.
Résultat bool

WinSecureStorageBase() protected méthode

Default constructor, validates settings, loads the store
protected WinSecureStorageBase ( ) : System
Résultat System

Property Details

StorageFile public_oe static_oe property

Name of the storage file.
public static string StorageFile
Résultat string

StoragePassword public_oe static_oe property

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

StoragePasswordArray protected_oe property

array corresponding to the password
protected byte[] StoragePasswordArray
Résultat byte[]