Generated by DocFX

Class EncryptionKey

Key container for the store of the key

Inheritance
System.Object
EncryptionKey
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: VEDriversLite.Security
Assembly: VEDriversLite.dll
Syntax
public class EncryptionKey

Constructors

| Improve this Doc View Source

EncryptionKey()

Declaration
public EncryptionKey()
| Improve this Doc View Source

EncryptionKey(String, Byte[], String, Boolean)

Declaration
public EncryptionKey(string key, byte[] iv, string password = "", bool fromDb = false)
Parameters
Type Name Description
System.String key
System.Byte[] iv
System.String password
System.Boolean fromDb
| Improve this Doc View Source

EncryptionKey(String, String, Boolean)

Constructor to load the key

Declaration
public EncryptionKey(string key, string password = "", bool fromDb = false)
Parameters
Type Name Description
System.String key

key in raw form. If it is already encrypted please set fromDb flag

System.String password

password to encrypt the key during the load to this container

System.Boolean fromDb

if this is set it will not encrypt the key with the provided password and just store key as it is. Pass must be loaded separately

Properties

| Improve this Doc View Source

Deleted

was key deleted

Declaration
public bool Deleted { get; set; }
Property Value
Type Description
System.Boolean
| Improve this Doc View Source

Id

ID of this key

Declaration
public Guid Id { get; set; }
Property Value
Type Description
System.Guid
| Improve this Doc View Source

IsEncrypted

Is the key encrypted flag

Declaration
public bool IsEncrypted { get; set; }
Property Value
Type Description
System.Boolean
| Improve this Doc View Source

IsLoaded

Is key loaded? Returns true if the key is not empty or null

Declaration
public bool IsLoaded { get; }
Property Value
Type Description
System.Boolean
| Improve this Doc View Source

IsPassLoaded

Is pass loaded? Returns true if the pass is loaded

Declaration
public bool IsPassLoaded { get; }
Property Value
Type Description
System.Boolean
| Improve this Doc View Source

IV

IV

Declaration
public byte[] IV { get; set; }
Property Value
Type Description
System.Byte[]
| Improve this Doc View Source

Name

Name of the key

Declaration
public string Name { get; set; }
Property Value
Type Description
System.String
| Improve this Doc View Source

PasswordHash

Password hash

Declaration
public byte[] PasswordHash { get; }
Property Value
Type Description
System.Byte[]
| Improve this Doc View Source

PasswordHashString

Declaration
public string PasswordHashString { get; }
Property Value
Type Description
System.String
| Improve this Doc View Source

PublicKey

Public key if there is some

Declaration
public string PublicKey { get; set; }
Property Value
Type Description
System.String
| Improve this Doc View Source

RelatedItemId

Related item ID

Declaration
public Guid RelatedItemId { get; set; }
Property Value
Type Description
System.Guid
| Improve this Doc View Source

Version

Version of the key

Declaration
public string Version { get; set; }
Property Value
Type Description
System.String

Methods

| Improve this Doc View Source

GetEncryptedKey(String, Boolean)

This is confusing, sorry will be renamed soon It returns decrypted key if the pass is loaded. If the pass is not loaded you need to provide pass If you want encrypted form of the key select returnEncrypted=true

Declaration
public string GetEncryptedKey(string password = "", bool returnEncrypted = false)
Parameters
Type Name Description
System.String password

fill if the pass is not loaded and you need decrypted key

System.Boolean returnEncrypted

set true for return enrcypted form of key

Returns
Type Description
System.String
| Improve this Doc View Source

LoadNewKey(String, String, Boolean)

Load the key and password. Same logic as constructor of this class

Declaration
public async Task<bool> LoadNewKey(string key, string password = "", bool fromDb = false)
Parameters
Type Name Description
System.String key
System.String password
System.Boolean fromDb
Returns
Type Description
System.Threading.Tasks.Task<System.Boolean>
| Improve this Doc View Source

LoadPassword(String)

Load the password to the container It will set passwordLoaded flag to true

Declaration
public void LoadPassword(string password)
Parameters
Type Name Description
System.String password
| Improve this Doc View Source

Lock()

Lock the account. It will remove the loaded password and set passwordloaded flag to false

Declaration
public void Lock()