public void RetreiveFile(string recordId, string fileId, string fileUri) { var encryptedFileUri = GetEncryptedFileUri(recordId, fileId); var encryptedBytes = DataGateway.GetBytes(encryptedFileUri); var fileByes = Cryptor.GetDecryptedContent <byte[]>(encryptedBytes, _password); DataGateway.PutBytes(fileUri, fileByes); }
public void UpsertRecord(Record record) { var recordFileUri = GetRecordFileUri(record.Header.Id); var encryptedRecordBytes = Cryptor.GetEncryptedBytes(record, _password); DataGateway.DeleteFileIfAvailable(recordFileUri); DataGateway.PutBytes(recordFileUri, encryptedRecordBytes); }
public void StoreFile(string recordId, string fileId, string fileUri) { var effectiveFile = GetEncryptedFileUri(recordId, fileId); var fileBytes = DataGateway.GetBytes(fileUri); var encryptedBytes = Cryptor.GetEncryptedBytes(fileBytes, _password); DataGateway.PutBytes(effectiveFile, encryptedBytes); }