Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
CngKeyBlobFormat.cs
Go to the documentation of this file.
2
4
5public sealed class CngKeyBlobFormat : IEquatable<CngKeyBlobFormat>
6{
8
10
12
14
16
18
20
22
23 private readonly string _format;
24
25 public string Format => _format;
26
27 public static CngKeyBlobFormat EccPrivateBlob => s_eccPrivate ?? (s_eccPrivate = new CngKeyBlobFormat("ECCPRIVATEBLOB"));
28
29 public static CngKeyBlobFormat EccPublicBlob => s_eccPublic ?? (s_eccPublic = new CngKeyBlobFormat("ECCPUBLICBLOB"));
30
32
33 public static CngKeyBlobFormat EccFullPublicBlob => s_eccFullPublic ?? (s_eccFullPublic = new CngKeyBlobFormat("ECCFULLPUBLICBLOB"));
34
36
38
40
41 public static CngKeyBlobFormat Pkcs8PrivateBlob => s_pkcs8Private ?? (s_pkcs8Private = new CngKeyBlobFormat("PKCS8_PRIVATEKEY"));
42
43 public CngKeyBlobFormat(string format)
44 {
45 if (format == null)
46 {
47 throw new ArgumentNullException("format");
48 }
49 if (format.Length == 0)
50 {
52 }
54 }
55
56 public static bool operator ==(CngKeyBlobFormat? left, CngKeyBlobFormat? right)
57 {
58 return left?.Equals(right) ?? ((object)right == null);
59 }
60
61 public static bool operator !=(CngKeyBlobFormat? left, CngKeyBlobFormat? right)
62 {
63 if ((object)left == null)
64 {
65 return (object)right != null;
66 }
67 return !left.Equals(right);
68 }
69
70 public override bool Equals([NotNullWhen(true)] object? obj)
71 {
72 return Equals(obj as CngKeyBlobFormat);
73 }
74
75 public bool Equals([NotNullWhen(true)] CngKeyBlobFormat? other)
76 {
77 if ((object)other == null)
78 {
79 return false;
80 }
81 return _format.Equals(other.Format);
82 }
83
84 public override int GetHashCode()
85 {
86 return _format.GetHashCode();
87 }
88
89 public override string ToString()
90 {
91 return _format;
92 }
93}
static string Cryptography_InvalidKeyBlobFormat
Definition SR.cs:76
static string Format(string resourceFormat, object p1)
Definition SR.cs:118
Definition SR.cs:7
bool Equals([NotNullWhen(true)] CngKeyBlobFormat? other)
static bool operator!=(CngKeyBlobFormat? left, CngKeyBlobFormat? right)
override bool Equals([NotNullWhen(true)] object? obj)
static bool operator==(CngKeyBlobFormat? left, CngKeyBlobFormat? right)