Class DataProtectionHelper<T>
Data protection class Given a type will store cache and help you protect and unprotect data as the given type
Inherited Members
Namespace: SecureExchangesSDK.Helpers
Assembly: SecureExchangesSDK.dll
Syntax
public static class DataProtectionHelper<T>
Type Parameters
| Name | Description |
|---|---|
| T |
Methods
GetUnprotectedAsType(string, bool, byte[])
Un protect a given file
Declaration
public static T GetUnprotectedAsType(string filePath, bool useCache = true, byte[] entropy = null)
Parameters
| Type | Name | Description |
|---|---|---|
| string | filePath | |
| bool | useCache | |
| byte[] | entropy |
Returns
| Type | Description |
|---|---|
| T | Return the T elem declared |
ProtectAndSaveToFile(string, string, byte[])
Takes the given data and protects to a filePath with DataProtectionAPI Will create the file or overwrite it if already created.
Declaration
public static void ProtectAndSaveToFile(string data, string filePath, byte[] entropy = null)
Parameters
| Type | Name | Description |
|---|---|---|
| string | data | |
| string | filePath | |
| byte[] | entropy |
UnprotectFromFile(string, bool, byte[])
Un protect a given file
Declaration
public static string UnprotectFromFile(string filePath, bool useCache = true, byte[] entropy = null)
Parameters
| Type | Name | Description |
|---|---|---|
| string | filePath | |
| bool | useCache | |
| byte[] | entropy |
Returns
| Type | Description |
|---|---|
| string | Returns a json string of element |