Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
CryptoConfigForwarder.cs
Go to the documentation of this file.
3
5
6internal static class CryptoConfigForwarder
7{
8 private static readonly Func<string, object> s_createFromName = BindCreateFromName();
9
10 [RequiresUnreferencedCode("The default algorithm implementations might be removed, use strong type references like 'RSA.Create()' instead.")]
11 private static Func<string, object> BindCreateFromName()
12 {
13 Type type = Type.GetType("System.Security.Cryptography.CryptoConfig, System.Security.Cryptography.Algorithms", throwOnError: true);
14 MethodInfo method = type.GetMethod("CreateFromName", new Type[1] { typeof(string) });
15 if (method == null)
16 {
17 throw new MissingMethodException(type.FullName, "CreateFromName");
18 }
19 return method.CreateDelegate<Func<string, object>>();
20 }
21
22 [RequiresUnreferencedCode("The default algorithm implementations might be removed, use strong type references like 'RSA.Create()' instead.")]
23 internal static object CreateFromName(string name)
24 {
25 return s_createFromName(name);
26 }
27
32}
virtual Delegate CreateDelegate(Type delegateType)
Definition MethodInfo.cs:48
static string Cryptography_DefaultAlgorithm_NotSupported
Definition SR.cs:34
Definition SR.cs:7
static readonly Func< string, object > s_createFromName
static ? Type GetType(string typeName, bool throwOnError, bool ignoreCase)
Definition Type.cs:408