mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2025-11-07 17:36:07 +00:00
Fix all warnings & Trim (#2226)
* Fix AutoFishing crash * Fix all warnings * Remove DotNetZip. * Fix the usage of HttpClient.
This commit is contained in:
parent
4aa6c1c99f
commit
1d52d1eadd
227 changed files with 2201 additions and 43564 deletions
|
|
@ -1,9 +1,5 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Security.Cryptography;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using MinecraftClient.Protocol.Message;
|
||||
|
||||
namespace MinecraftClient.Protocol.Keys
|
||||
|
|
@ -18,26 +14,26 @@ namespace MinecraftClient.Protocol.Keys
|
|||
|
||||
public PublicKey(string pemKey, string? sig = null, string? sigV2 = null)
|
||||
{
|
||||
this.Key = KeyUtils.DecodePemKey(pemKey, "-----BEGIN RSA PUBLIC KEY-----", "-----END RSA PUBLIC KEY-----");
|
||||
Key = KeyUtils.DecodePemKey(pemKey, "-----BEGIN RSA PUBLIC KEY-----", "-----END RSA PUBLIC KEY-----");
|
||||
|
||||
this.rsa = RSA.Create();
|
||||
rsa.ImportSubjectPublicKeyInfo(this.Key, out _);
|
||||
rsa = RSA.Create();
|
||||
rsa.ImportSubjectPublicKeyInfo(Key, out _);
|
||||
|
||||
if (!string.IsNullOrEmpty(sig))
|
||||
this.Signature = Convert.FromBase64String(sig);
|
||||
Signature = Convert.FromBase64String(sig);
|
||||
|
||||
if (!string.IsNullOrEmpty(sigV2))
|
||||
this.SignatureV2 = Convert.FromBase64String(sigV2!);
|
||||
SignatureV2 = Convert.FromBase64String(sigV2!);
|
||||
}
|
||||
|
||||
public PublicKey(byte[] key, byte[] signature)
|
||||
{
|
||||
this.Key = key;
|
||||
Key = key;
|
||||
|
||||
this.rsa = RSA.Create();
|
||||
rsa.ImportSubjectPublicKeyInfo(this.Key, out _);
|
||||
rsa = RSA.Create();
|
||||
rsa.ImportSubjectPublicKeyInfo(Key, out _);
|
||||
|
||||
this.Signature = signature;
|
||||
Signature = signature;
|
||||
}
|
||||
|
||||
public bool VerifyData(byte[] data, byte[] signature)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue