Repository navigation
Commit eade50f
committed
Fix key length error message in ArgumentOutOfRangeException
Updated the error message in `ArgumentOutOfRangeException` to
correctly reflect the required key lengths for the algorithm.
The message now specifies that the key length must be 256, 384,
or 512 bits (32, 48, or 64 symbols), aligning with the logic
in the `switch` statement. This improves clarity and prevents
developer confusion.
Update key length logic to use UTF-8 byte count
Refactor key length validation to use UTF-8 byte count instead of symbol count. Introduced `utf8KeyLength` to calculate the byte length of the key. Updated `algorithm` selection logic to use `utf8KeyLength` for determining the appropriate `SecurityAlgorithms` value. Adjusted exception message to reflect the change, specifying key length in bytes rather than symbols.1 parent 1902fae commit eade50f
1 file changed
Lines changed: 3 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
| 26 | + | |
| 27 | + | |
27 | 28 | | |
28 | 29 | | |
29 | 30 | | |
30 | 31 | | |
31 | | - | |
| 32 | + | |
32 | 33 | | |
33 | 34 | | |
34 | 35 | | |
| |||
0 commit comments