/// <summary> /// ctor /// </summary> /// <param name="Store">an ISecureStorage implementation</param> /// <param name="key">an encryption key</param> /// <param name="iv">an encryption iv</param> /// <param name="fragment_size">max message size before fragmentation occurs</param> public SecureStorage(IStorage store, CryptographyLib.ICryptography crypto, int fragment_size = 0) { this.store = store; this.crypto = crypto; FRAGMENT_SIZE = fragment_size; CurrentDirectory = "/"; }
/// <summary> /// DescriptorExists /// </summary> /// <param name="sercure_name"></param> /// <param name="store"></param> /// <param name="crypto"></param> /// <returns></returns> public static bool DescriptorExists(string sercure_name, IStorage store, CryptographyLib.ICryptography crypto) { string sub_dir_name = StoragePath.GetDirectory(sercure_name); string secure_sub_dir_name = SecureStorageUtility.GetSecureName(sub_dir_name, crypto.Key); return(store.Exists(secure_sub_dir_name)); }
public byte[] Decrypt(CryptographyLib.ICryptography crypt, byte[] data) { return(crypt.Decrypt(data)); }