public static IDstFSInterop Load(string accountid, string applicationkey, string bucketid, string bucketname, string connectionSettingsFile = null, string password = null) { BackblazeDstInterop backblazeDstInterop = new BackblazeDstInterop(accountid, applicationkey, bucketid, bucketname, connectionSettingsFile); if (password != null) { byte[] keyfile = backblazeDstInterop.LoadIndexFileAsync(null, IndexFileType.EncryptorKeyFile).Result; AesHelper encryptor = AesHelper.CreateFromKeyFile(keyfile, password); backblazeDstInterop.Encryptor = encryptor; } return(backblazeDstInterop); }
public static IDstFSInterop InitializeNew(string accountid, string applicationkey, string bucketid, string bucketname, string connectionSettingsFile = null, string password = null) { BackblazeDstInterop backblazeDstInterop = new BackblazeDstInterop(accountid, applicationkey, bucketid, bucketname, connectionSettingsFile); if (password != null) { AesHelper encryptor = AesHelper.CreateFromPassword(password); byte[] keyfile = encryptor.CreateKeyFile(); backblazeDstInterop.StoreIndexFileAsync(null, IndexFileType.EncryptorKeyFile, keyfile).Wait(); backblazeDstInterop.Encryptor = encryptor; } return(backblazeDstInterop); }