Class provides an abstract virtual drive that can be extended for use with any filesystem ie disk, net, cloud, etc. Drive implementations needs to be realized together with IRealFile }.
More...
|
void | SetPassword (string pass) |
| Change the user password.
|
|
byte[] | GetAuthIdBytes () |
| Get the device authorization byte array for the current drive.
|
|
string | GetDefaultAuthConfigFilename () |
| Get the default authorization config filename.
|
|
byte[] | GetNextNonce (SalmonDrive salmonDrive) |
| Get the next nonce for the drive. This operation IS atomic as per transaction.
|
|
void | RevokeAuthorization () |
| Revoke authorization for this device. This will effectively terminate write operations on the current disk by the current device. Warning: If you need to authorize write operations to the device again you will need to have another device to export an authorization config file and reimport it.
|
|
string | GetAuthId () |
| Get the authorization ID for the current device.
|
|
byte[] | GetBytesFromRealFile (IRealFile file, int bufferSize) |
| Get the byte contents of a file from the real filesystem.
|
|
bool | HasConfig () |
| Return true if the drive is already created and has a configuration file.
|
|
void | Close () |
| Close the drive and close associated resources.
|
|
void | OnUnlockSuccess () |
|
void | OnUnlockError () |
|
|
void | Initialize (IRealFile realRoot, bool createIfNotExists=false) |
| Create a virtual drive at the directory path provided.
|
|
void | InitFS () |
| Initialize the drive virtual filesystem.
|
|
SalmonDriveConfig | GetDriveConfig () |
| Return the configuration properties of this drive.
|
|
|
static string | ConfigFilename = "vault.slmn" [get, set] |
| Default config filename.
|
|
static string | AuthConfigFilename = "auth.slma" [get, set] |
| Default aUthorization filename.
|
|
static string | VirtualDriveDirectoryName = "fs" [get, set] |
| Virtual drive directory to host the encrypted files.
|
|
static string | ShareDirectoryName = "share" [get, set] |
| Default shared directory.
|
|
static string | ExportDirectoryName = "export" [get, set] |
| Default export directory filename.
|
|
int | DefaultFileChunkSize = DEFAULT_FILE_CHUNK_SIZE [get, set] |
| Default file chunk that will be used to import new files.
|
|
SalmonDriveKey | Key = null [get] |
| The current key.
|
|
byte[] | DriveId [get] |
| The current drive ID.
|
|
IRealFile | RealRoot = null [get] |
| The real root location of the vault.
|
|
INonceSequencer | Sequencer [get, set] |
| Set the nonce sequencer used for the current drive.
|
|
override SalmonFile | Root [get] |
| Return the virtual root directory of the drive.
|
|
IRealFile | ExportDir [get] |
| Return the default external export dir that all file can be exported to.
|
|
IRealFile | PrivateDir [get] |
| Get the private directory for this drive.
|
|
IVirtualFile | Root [get] |
| Get the root directory.
|
|
Class provides an abstract virtual drive that can be extended for use with any filesystem ie disk, net, cloud, etc. Drive implementations needs to be realized together with IRealFile }.
◆ CreateDrive()
Create a new drive in the provided location.
- Parameters
-
dir | Directory to store the drive configuration and virtual filesystem. |
driveClassType | The drive class type of this drive (ie typeof(DotNetDrive)) |
password | Master password to encrypt the drive configuration. |
sequencer | The sequencer |
- Returns
- The newly created drive.
- Exceptions
-
IntegrityException | Thrown when data are corrupt or tampered with. |
SequenceException | Thrown when there is a failure in the nonce sequencer. |
◆ GetAuthId()
string Mku.Salmon.SalmonDrive.GetAuthId |
( |
| ) |
|
Get the authorization ID for the current device.
- Returns
- The authorization id
- Exceptions
-
SequenceException | Thrown when there is a failure in the nonce sequencer. |
SalmonAuthException | Thrown when there is a failure during authorization |
◆ GetAuthIdBytes()
byte[] Mku.Salmon.SalmonDrive.GetAuthIdBytes |
( |
| ) |
|
Get the device authorization byte array for the current drive.
- Returns
- The authorization id
- Exceptions
-
Exception | Thrown if error during operation |
◆ GetBytesFromRealFile()
byte[] Mku.Salmon.SalmonDrive.GetBytesFromRealFile |
( |
IRealFile | file, |
|
|
int | bufferSize ) |
Get the byte contents of a file from the real filesystem.
- Parameters
-
file | The file |
bufferSize | The buffer to be used when reading |
◆ GetDefaultAuthConfigFilename()
string Mku.Salmon.SalmonDrive.GetDefaultAuthConfigFilename |
( |
| ) |
|
Get the default authorization config filename.
- Returns
- The default authorization configuration file name
◆ GetNextNonce()
byte[] Mku.Salmon.SalmonDrive.GetNextNonce |
( |
SalmonDrive | salmonDrive | ) |
|
Get the next nonce for the drive. This operation IS atomic as per transaction.
- Parameters
-
- Returns
- The next nonce
- Exceptions
-
SequenceException | Thrown when there is a failure in the nonce sequencer. |
SalmonRangeExceededException | Thrown when maximum nonce range is exceeded. |
◆ Initialize()
void Mku.Salmon.SalmonDrive.Initialize |
( |
IRealFile | realRoot, |
|
|
bool | createIfNotExists = false ) |
|
protected |
Create a virtual drive at the directory path provided.
- Parameters
-
realRoot | The root of the real directory |
createIfNotExists | Create the drive if it does not exist |
◆ OpenDrive()
Set the drive location to an external directory. This requires you previously use SetDriveClass() to provide a class for the drive.
- Parameters
-
dir | The directory that will be used for storing the contents of the drive |
driveClassType | The class type of the drive (ie: typeof(DotNetDrive)) |
password | password |
sequencer | The sequencer |
◆ RevokeAuthorization()
void Mku.Salmon.SalmonDrive.RevokeAuthorization |
( |
| ) |
|
Revoke authorization for this device. This will effectively terminate write operations on the current disk by the current device. Warning: If you need to authorize write operations to the device again you will need to have another device to export an authorization config file and reimport it.
See: README.md
- Exceptions
-
Exception | Thrown if error during operation |
◆ SetPassword()
void Mku.Salmon.SalmonDrive.SetPassword |
( |
string | pass | ) |
|
Change the user password.
- Parameters
-
- Exceptions
-
IOException | Thrown if error during IO |
SalmonAuthException | Thrown when there is a failure during authorization |
SalmonSecurityException | Thrown when error with security |
IntegrityException | Thrown when data are corrupt or tampered with. |
SequenceException | Thrown when there is a failure in the nonce sequencer. |
◆ ExportDir
Return the default external export dir that all file can be exported to.
- Returns
- The file on the real filesystem.
◆ Root
Return the virtual root directory of the drive.
- Returns
- The root directory
- Exceptions
-
The documentation for this class was generated from the following file: