C# Class GSF.Security.Cryptography.Cipher.KeyIVCache

Represents an inter-process serializable cryptographic key and initialization vector cache.
Inheritance: GSF.IO.InterprocessCache
Exibir arquivo Open project: GridProtectionAlliance/gsf

Private Properties

Property Type Description
WaitForDataReady void

Public Methods

Method Description
ExportKeyIV ( string password, int keySize ) : string

Exports a key and initialization vector from the local system key cache.

This method is used to manually export a key to be installed on another computer.

GetCryptoKeyIV ( string password, int keySize ) : byte[][]

Gets the crypto key and initialization vector for the given user password.

ImportKeyIV ( string password, int keySize, string keyIVText ) : void

Imports a key and initialization vector into the local system key cache.

This method is used to manually import a key created on another computer.

KeyIVExists ( string password, int keySize ) : bool

Determines if a key and initialization vector exists for the given password.

MergeLeft ( KeyIVCache other ) : void

Merge keys and initialization vectors from another KeyIVCache, local cache taking precedence.

MergeRight ( KeyIVCache other ) : void

Merge keys and initialization vectors from another KeyIVCache, other cache taking precedence.

Save ( ) : void

Initiates inter-process synchronized save of key and initialization vector table.

Protected Methods

Method Description
LoadFileData ( FileStream fileStream ) : byte[]

Handles deserialization of file from disk; virtual method allows customization (e.g., pre-load decryption and/or data merge).

Consumers overriding this method should not directly call InterprocessCache.FileData property to avoid potential dead-locks.

SaveFileData ( FileStream fileStream, byte fileData ) : void

Handles serialization of file to disk; virtual method allows customization (e.g., pre-save encryption and/or data merge).

Consumers overriding this method should not directly call InterprocessCache.FileData property to avoid potential dead-locks.

Private Methods

Method Description
WaitForDataReady ( ) : void

Method Details

ExportKeyIV() public method

Exports a key and initialization vector from the local system key cache.
This method is used to manually export a key to be installed on another computer.
public ExportKeyIV ( string password, int keySize ) : string
password string User password used for key lookup.
keySize int Specifies the desired key size.
return string

GetCryptoKeyIV() public method

Gets the crypto key and initialization vector for the given user password.
public GetCryptoKeyIV ( string password, int keySize ) : byte[][]
password string User password used for key lookup.
keySize int Specifies the desired key size.
return byte[][]

ImportKeyIV() public method

Imports a key and initialization vector into the local system key cache.
This method is used to manually import a key created on another computer.
public ImportKeyIV ( string password, int keySize, string keyIVText ) : void
password string User password used for key lookups.
keySize int Specifies the desired key size.
keyIVText string Text based key and initialization vector to import into local key cache.
return void

KeyIVExists() public method

Determines if a key and initialization vector exists for the given password.
public KeyIVExists ( string password, int keySize ) : bool
password string User password used for key lookups.
keySize int Specifies the desired key size.
return bool

LoadFileData() protected method

Handles deserialization of file from disk; virtual method allows customization (e.g., pre-load decryption and/or data merge).
Consumers overriding this method should not directly call InterprocessCache.FileData property to avoid potential dead-locks.
protected LoadFileData ( FileStream fileStream ) : byte[]
fileStream System.IO.FileStream used to deserialize data.
return byte[]

MergeLeft() public method

Merge keys and initialization vectors from another KeyIVCache, local cache taking precedence.
public MergeLeft ( KeyIVCache other ) : void
other KeyIVCache Other to merge with.
return void

MergeRight() public method

Merge keys and initialization vectors from another KeyIVCache, other cache taking precedence.
public MergeRight ( KeyIVCache other ) : void
other KeyIVCache Other to merge with.
return void

Save() public method

Initiates inter-process synchronized save of key and initialization vector table.
public Save ( ) : void
return void

SaveFileData() protected method

Handles serialization of file to disk; virtual method allows customization (e.g., pre-save encryption and/or data merge).
Consumers overriding this method should not directly call InterprocessCache.FileData property to avoid potential dead-locks.
protected SaveFileData ( FileStream fileStream, byte fileData ) : void
fileStream System.IO.FileStream used to serialize data.
fileData byte File data to be serialized.
return void