mirror of
https://gitee.com/fudiwei/DotNetCore.SKIT.FlurlHttpClient.Wechat.git
synced 2025-09-19 01:58:14 +08:00
style: clean code
This commit is contained in:
@@ -85,7 +85,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
|
||||
byte[] plainBytes = Utilities.SM4Utility.DecryptWithGCM(
|
||||
keyBytes: keyBytes,
|
||||
nonceBytes: Encoding.UTF8.GetBytes(resource.Nonce),
|
||||
aadBytes: Encoding.UTF8.GetBytes(resource.AssociatedData),
|
||||
aadBytes: resource.AssociatedData is null ? null : Encoding.UTF8.GetBytes(resource.AssociatedData),
|
||||
cipherBytes: Convert.FromBase64String(resource.CipherText)
|
||||
);
|
||||
plainJson = Encoding.UTF8.GetString(plainBytes);
|
||||
|
@@ -142,11 +142,6 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Settings
|
||||
|
||||
public bool Equals(CertificateEntry other)
|
||||
{
|
||||
if (ReferenceEquals(null, other))
|
||||
return false;
|
||||
if (ReferenceEquals(this, other))
|
||||
return true;
|
||||
|
||||
return string.Equals(AlgorithmType, other.AlgorithmType) &&
|
||||
string.Equals(Certificate, other.Certificate) &&
|
||||
string.Equals(SerialNumber, other.SerialNumber);
|
||||
@@ -156,8 +151,6 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Settings
|
||||
{
|
||||
if (ReferenceEquals(null, obj))
|
||||
return false;
|
||||
if (ReferenceEquals(this, obj))
|
||||
return true;
|
||||
if (GetType() != obj.GetType())
|
||||
return false;
|
||||
|
||||
|
@@ -68,7 +68,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Utilities
|
||||
byte[] plainBytes = DecryptWithGCM(
|
||||
keyBytes: Encoding.UTF8.GetBytes(key),
|
||||
nonceBytes: Encoding.UTF8.GetBytes(nonce),
|
||||
aadBytes: Encoding.UTF8.GetBytes(aad ?? string.Empty),
|
||||
aadBytes: aad is null ? null : Encoding.UTF8.GetBytes(aad),
|
||||
cipherBytes: Convert.FromBase64String(cipherText),
|
||||
paddingMode: paddingMode
|
||||
);
|
||||
|
Reference in New Issue
Block a user