EaseFilter Demo Project
|
DigitalRightControl.cs
Go to the documentation of this file.
178 private static byte[] GetPolicyBuffer(long fileSize,DRPolicyData policy,byte[] iv, byte[] encryptionKey)
202 // sizeof(OffsetOfIncludeProcessNames) + sizeof(OffsetOfExcludeProcessNames) + sizeof(LengthOfExcludeProcessNames)
203 // + sizeof(OffsetOfIncludeUserNames) + sizeof(LengthOfIncludeUserNames) + sizeof(OffsetOfExcludeUserNames) + sizeof(LengthOfExcludeUserNames)
204 // + sizeof(OffsetOfAccountName) + sizeof(LengthOfAccountName) + sizeof(OffsetOfComputerIds) + sizeof(LengthOfComputerIds)
211 policy.OffsetOfExcludeProcessNames = policy.OffsetOfIncludeProcessNames + policy.LengthOfIncludeProcessNames;
215 policy.OffsetOfIncludeUserNames = policy.OffsetOfExcludeProcessNames + policy.LengthOfExcludeProcessNames;
219 policy.OffsetOfExcludeUserNames = policy.OffsetOfIncludeUserNames + policy.LengthOfIncludeUserNames;
296 public static bool EncryptFileWithEmbeddedDRPolicy(string sourceFileName, string destFileName, byte[] encryptIV, byte[] encryptKey,DRPolicyData policy, out string lastError)
317 ret = FilterAPI.AESEncryptFileToFile(sourceFileName, destFileName, (uint)encryptKey.Length, encryptKey, (uint)encryptIV.Length, encryptIV, false);
320 lastError = "Create encrypt file " + destFileName + " failed with error:" + FilterAPI.GetLastErrorMessage();
391 lastError = fileName + " is not valid share encrypted file, the sizeOfAESData:" + sizeOfAESData + " >= file size:" + fileSize;
401 //decrypt the embedded data, since the last 4 bytes is not encrypted, after decryption,need to write the clear size back.
404 //since the last 4 bytes for sizeOfAESData is not encrypted, we need to put back the clear value back.
413 lastError = fileName + " is not valid share encrypted file, the encryption key:" + verificationKey + " is not valid.";
448 string decryptedStr = FilterAPI.AESEncryptDecryptStr(toDeserialize, FilterAPI.EncryptType.Decryption);
461 string encryptedText = FilterAPI.AESEncryptDecryptStr(textWriter.ToString(), FilterAPI.EncryptType.Encryption);
static bool ProcessSecureShareFile(string fileName, out string lastError)
Process the encrypted file's embedded access policy, remove embedded information, add AESTagData to e...
Definition: DigitalRightControl.cs:357
uint LengthOfComputerIds
Definition: DigitalRightControl.cs:117
enum _AESFlags AESFlags
Definition: FilterAPI.h:61
string ExcludeUserNames
If it is not empty, all the useres in the user name list can not access the files.
Definition: DigitalRightControl.cs:60
string ComputerIds
Definition: DigitalRightControl.cs:126
uint AESVerificationKey
Definition: DigitalRightControl.cs:95
uint LengthOfExcludeUserNames
Definition: DigitalRightControl.cs:113
long CreationTime
Definition: DigitalRightControl.cs:103
uint OffsetOfIncludeProcessNames
Definition: DigitalRightControl.cs:108
uint OffsetOfUserPassword
Definition: DigitalRightControl.cs:120
long ExpireTime
The file will be expired after the expire time, and it can't be accessed.
Definition: DigitalRightControl.cs:76
uint LengthOfUserPassword
Definition: DigitalRightControl.cs:119
uint OffsetOfComputerIds
Definition: DigitalRightControl.cs:118
uint SizeOfAESData
Definition: DigitalRightControl.cs:128
string ComputerId
the computer information which access the file.
Definition: DigitalRightControl.cs:155
Definition: FilterAPI.h:57
Definition: FilterAPI.h:62
Definition: FilterAPI.h:53
Definition: FilterAPI.h:56
string ExcludeProcessNames
Definition: DigitalRightControl.cs:122
Definition: FilterAPI.h:58
string IncludeUserNames
If it is not empty, only the users in the user name list can access the files.
Definition: DigitalRightControl.cs:56
string IncludeProcessNames
If it is not empty, only the processes in the process list can access the files.
Definition: DigitalRightControl.cs:48
uint LengthOfIncludeProcessNames
Definition: DigitalRightControl.cs:107
uint OffsetOfIncludeUserNames
Definition: DigitalRightControl.cs:112
uint LengthOfIncludeUserNames
Definition: DigitalRightControl.cs:111
long ExpireTime
Definition: DigitalRightControl.cs:104
uint OffsetOfExcludeUserNames
Definition: DigitalRightControl.cs:114
string AccountName
Definition: DigitalRightControl.cs:125
AESFlags AESFlags
Definition: DigitalRightControl.cs:96
This is the DR info meta data which will be stored in server if revoke access control is enabled...
Definition: DigitalRightControl.cs:43
byte [] EncryptionKey
Definition: DigitalRightControl.cs:102
uint EncryptionKeyLength
Definition: DigitalRightControl.cs:100
Definition: FilterAPI.h:55
uint AccessFlags
Definition: DigitalRightControl.cs:105
uint OffsetOfExcludeProcessNames
Definition: DigitalRightControl.cs:110
long CreationTime
the creation time of the file which was accessed.
Definition: DigitalRightControl.cs:163
This the DR data which will be embedded to the encyrpted file if the revoke access control flag is no...
Definition: DigitalRightControl.cs:93
uint LengthOfExcludeProcessNames
Definition: DigitalRightControl.cs:109
string ExcludeProcessNames
If it is not empty, all the processes in the process list can not access the files.
Definition: DigitalRightControl.cs:52
string UserPassword
Definition: DigitalRightControl.cs:127
Definition: FilterAPI.h:54
string ExcludeUserNames
Definition: DigitalRightControl.cs:124
string IncludeUserNames
Definition: DigitalRightControl.cs:123
static bool EncryptFileWithEmbeddedDRPolicy(string sourceFileName, string destFileName, byte[] encryptIV, byte[] encryptKey, DRPolicyData policy, out string lastError)
Create an encrypted file with embedded digital right policy, distribute the encrypted file via intern...
Definition: DigitalRightControl.cs:296
uint LengthOfAccountName
Definition: DigitalRightControl.cs:115
Definition: FilterAPI.h:59
uint OffsetOfAccountName
Definition: DigitalRightControl.cs:116
string IncludeProcessNames
Definition: DigitalRightControl.cs:121
string IncludeComputerIds
If it is not empty, only the computer in the computer id list can access the files.
Definition: DigitalRightControl.cs:64
Services Overview
Architect, implement and test file system filter drivers for a wide range of functionality. We can offer several levels of assistance to meet your specific.
Contact Us
You are welcome to contact us for salse or partnership.
Sales: sales@easefilter.com
Support: support@easefilter.com
Info: info@easefilter.com