C# Класс Plugin.SecureStorage.WinSecureStorageBase

Base class for handling in memory operation for windows platform The derived classes must take care of persisting the information
Наследование: Plugin.SecureStorage.Abstractions.SecureStorageImplementationBase
Показать файл Открыть проект

Открытые свойства

Свойство Тип Описание
StorageFile string
StoragePassword string

Защищенные свойства (Protected)

Свойство Тип Описание
StoragePasswordArray byte[]

Открытые методы

Метод Описание
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.

Защищенные методы

Метод Описание
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

Приватные методы

Метод Описание
LoadFromStorage ( ) : void

Loads the dictionary from storge

SaveToStorage ( ) : void

method to encrypt and save dictionary to storage

Описание методов

DeleteKey() публичный Метод

Deletes the key and corresponding value from the storage
public DeleteKey ( string key ) : bool
key string Key.
Результат bool

GetValue() публичный Метод

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.
Результат string

HasKey() публичный Метод

Determines whether specified key exists in the storage
public HasKey ( string key ) : bool
key string Key.
Результат bool

LoadData() защищенный абстрактный Метод

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[]
Результат byte[]

SaveData() защищенный абстрактный Метод

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
Результат void

SetValue() публичный Метод

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.
Результат bool

WinSecureStorageBase() защищенный Метод

Default constructor, validates settings, loads the store
protected WinSecureStorageBase ( ) : System
Результат System

Описание свойств

StorageFile публичное статическое свойство

Name of the storage file.
public static string StorageFile
Результат string

StoragePassword публичное статическое свойство

Password for storage. Must be set prior to usage in Android and Windows
public static string StoragePassword
Результат string

StoragePasswordArray защищенное свойство

array corresponding to the password
protected byte[] StoragePasswordArray
Результат byte[]