Terraria v1.4.4.9
Terraria source code documentation
All Classes Namespaces Files Functions Variables Enumerations Enumerator Properties Events Macros

◆ PrivateKey

AsymmetricAlgorithm? System.Security.Cryptography.X509Certificates.X509Certificate2.PrivateKey
getset

Definition at line 104 of file X509Certificate2.cs.

105 {
106 get
107 {
109 if (!HasPrivateKey)
110 {
111 return null;
112 }
113 if (_lazyPrivateKey == null)
114 {
115 string keyAlgorithm = GetKeyAlgorithm();
116 AsymmetricAlgorithm lazyPrivateKey;
117 if (!(keyAlgorithm == "1.2.840.113549.1.1.1"))
118 {
119 if (!(keyAlgorithm == "1.2.840.10040.4.1"))
120 {
121 throw new NotSupportedException(System.SR.NotSupported_KeyAlgorithm);
122 }
123 lazyPrivateKey = Pal.GetDSAPrivateKey();
124 }
125 else
126 {
127 lazyPrivateKey = Pal.GetRSAPrivateKey();
128 }
130 }
131 return _lazyPrivateKey;
132 }
133 set
134 {
135 throw new PlatformNotSupportedException();
136 }
137 }
static string NotSupported_KeyAlgorithm
Definition SR.cs:114
Definition SR.cs:7