Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
RSAEncryptionPadding.cs
Go to the documentation of this file.
3
5
6[UnsupportedOSPlatform("browser")]
7public sealed class RSAEncryptionPadding : IEquatable<RSAEncryptionPadding>
8{
10
12
14
16
18
20
22
24
26
28
30
32
34
36
38 {
39 _mode = mode;
40 _oaepHashAlgorithm = oaepHashAlgorithm;
41 }
42
44 {
45 if (string.IsNullOrEmpty(hashAlgorithm.Name))
46 {
48 }
49 return new RSAEncryptionPadding(RSAEncryptionPaddingMode.Oaep, hashAlgorithm);
50 }
51
52 public override int GetHashCode()
53 {
55 }
56
57 private static int CombineHashCodes(int h1, int h2)
58 {
59 return ((h1 << 5) + h1) ^ h2;
60 }
61
62 public override bool Equals([NotNullWhen(true)] object? obj)
63 {
65 }
66
67 public bool Equals([NotNullWhen(true)] RSAEncryptionPadding? other)
68 {
69 if ((object)other != null && _mode == other._mode)
70 {
71 return _oaepHashAlgorithm == other._oaepHashAlgorithm;
72 }
73 return false;
74 }
75
76 public static bool operator ==(RSAEncryptionPadding? left, RSAEncryptionPadding? right)
77 {
78 return left?.Equals(right) ?? ((object)right == null);
79 }
80
81 public static bool operator !=(RSAEncryptionPadding? left, RSAEncryptionPadding? right)
82 {
83 return !(left == right);
84 }
85
86 public override string ToString()
87 {
88 return _mode.ToString() + _oaepHashAlgorithm.Name;
89 }
90}
static string Cryptography_HashAlgorithmNameNullOrEmpty
Definition SR.cs:60
Definition SR.cs:7
static readonly RSAEncryptionPadding s_oaepSHA1
static bool operator==(RSAEncryptionPadding? left, RSAEncryptionPadding? right)
static bool operator!=(RSAEncryptionPadding? left, RSAEncryptionPadding? right)
bool Equals([NotNullWhen(true)] RSAEncryptionPadding? other)
static readonly RSAEncryptionPadding s_oaepSHA256
static RSAEncryptionPadding CreateOaep(HashAlgorithmName hashAlgorithm)
override bool Equals([NotNullWhen(true)] object? obj)
RSAEncryptionPadding(RSAEncryptionPaddingMode mode, HashAlgorithmName oaepHashAlgorithm)
static readonly RSAEncryptionPadding s_oaepSHA384
static readonly RSAEncryptionPadding s_pkcs1
static readonly RSAEncryptionPadding s_oaepSHA512