Skip to content

Commit 3891c0b

Browse files
committed
Minor adjustments
1 parent 1963675 commit 3891c0b

6 files changed

Lines changed: 17 additions & 5 deletions

File tree

lib/nwebdav

src/Platforms/SecureFolderFS.UI/ViewModels/Authentication/KeyFileViewModel.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ public override async Task<IKey> EnrollAsync(string id, byte[]? data, Cancellati
7070
dataStream.Position = 0L;
7171
var result = await FileExplorerService.SaveFileAsync("Vault key file", dataStream, new Dictionary<string, string>()
7272
{
73-
{ "Key File", Constants.FileNames.KEY_FILE_EXTENSION },
73+
{ "KeyFile".ToLocalized(), Constants.FileNames.KEY_FILE_EXTENSION },
7474
{ "All Files", "*" }
7575
}, cancellationToken);
7676

src/Shared/SecureFolderFS.Shared/ComponentModel/IKey.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,9 @@ namespace SecureFolderFS.Shared.ComponentModel
88
/// </summary>
99
public interface IKey : IEnumerable<byte>, IDisposable
1010
{
11+
/// <summary>
12+
/// Gets the number of bytes in the key.
13+
/// </summary>
14+
int Length { get; }
1115
}
1216
}

src/Shared/SecureFolderFS.Shared/Models/DisposablePassword.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ public sealed class DisposablePassword : IPassword
1414
/// <inheritdoc/>
1515
public int CharacterCount { get; }
1616

17+
/// <inheritdoc/>
18+
public int Length => _password.Length;
19+
1720
public DisposablePassword(string password)
1821
{
1922
_password = Encoding.UTF8.GetBytes(password);

src/Shared/SecureFolderFS.Shared/Models/KeySequence.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
using SecureFolderFS.Shared.Extensions;
33
using System.Collections;
44
using System.Collections.Generic;
5+
using System.Linq;
56

67
namespace SecureFolderFS.Shared.Models
78
{
@@ -12,9 +13,15 @@ public sealed class KeySequence : IKey
1213
{
1314
private readonly List<IKey> _keys;
1415

16+
public IReadOnlyCollection<IKey> Keys => _keys;
17+
18+
/// <summary>
19+
/// Gets the number of keys in the sequence.
20+
/// </summary>
1521
public int Count => _keys.Count;
1622

17-
public IReadOnlyCollection<IKey> Keys => _keys;
23+
/// <inheritdoc/>
24+
public int Length => _keys.Sum(key => key.Length);
1825

1926
public KeySequence()
2027
{

src/Shared/SecureFolderFS.Storage/VirtualFileSystem/VirtualFileSystemOptions.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
using SecureFolderFS.Shared.Extensions;
22
using System;
33
using System.Collections.Generic;
4-
using System.ComponentModel;
5-
using System.Runtime.CompilerServices;
64

75
namespace SecureFolderFS.Storage.VirtualFileSystem
86
{

0 commit comments

Comments
 (0)