Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
RSAPKCS1SignatureFormatter.cs
Go to the documentation of this file.
3
5
6[UnsupportedOSPlatform("browser")]
8{
9 private RSA _rsaKey;
10
11 private string _algName;
12
14 {
15 }
16
18 {
19 if (key == null)
20 {
21 throw new ArgumentNullException("key");
22 }
23 _rsaKey = (RSA)key;
24 }
25
26 public override void SetKey(AsymmetricAlgorithm key)
27 {
28 if (key == null)
29 {
30 throw new ArgumentNullException("key");
31 }
32 _rsaKey = (RSA)key;
33 }
34
35 public override void SetHashAlgorithm(string strName)
36 {
37 if (CryptoConfig.MapNameToOID(strName) != null)
38 {
40 }
41 else
42 {
43 _algName = null;
44 }
45 }
46
47 public override byte[] CreateSignature(byte[] rgbHash)
48 {
49 if (rgbHash == null)
50 {
51 throw new ArgumentNullException("rgbHash");
52 }
53 if (_algName == null)
54 {
56 }
57 if (_rsaKey == null)
58 {
60 }
62 }
63}
static string ToUpper(string hashAlgorithName)
static string Cryptography_MissingOID
Definition SR.cs:116
static string Cryptography_MissingKey
Definition SR.cs:114
Definition SR.cs:7
static ? string MapNameToOID(string name)
virtual byte[] SignHash(byte[] hash, HashAlgorithmName hashAlgorithm, RSASignaturePadding padding)
Definition RSA.cs:70