blob: 5fef7ec09080f6ddd2226334e0c8766976e71f53 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
|
//
// System.Security.Cryptography KeySizes Class implementation
//
// Author:
// Matthew S. Ford (Matthew.S.Ford@Rose-Hulman.Edu)
//
// Copyright 2001 by Matthew S. Ford.
//
namespace System.Security.Cryptography {
/// <summary>
/// This class represents valid ranges of key sizes for ciphers. It is also used to represent block sizes in the same fashion for block ciphers.
/// </summary>
public class KeySizes {
private int _maxSize;
private int _minSize;
private int _skipSize;
/// <summary>
/// Creates a new KeySizes object.
/// </summary>
/// <param name="minSize">The minimum size key allowed for this cipher.</param>
/// <param name="maxSize">The maximum size key allowed for this cipher.</param>
/// <param name="skipSize">The jump/skip between the valid key sizes.</param>
public KeySizes (int minSize, int maxSize, int skipSize) {
_maxSize = maxSize;
_minSize = minSize;
_skipSize = skipSize;
}
/// <summary>
/// Returns the maximum valid key size;
/// </summary>
public int MaxSize {
get {
return _maxSize;
}
}
/// <summary>
/// Returns the minimum valid key size;
/// </summary>
public int MinSize {
get {
return _minSize;
}
}
/// <summary>
/// Returns the skip between valid key sizes;
/// </summary>
public int SkipSize {
get {
return _skipSize;
}
}
}
}
|