From db04df57970fd441f2caba2d08e0743449654b0d Mon Sep 17 00:00:00 2001 From: "nicolas.dorier" Date: Fri, 5 Jul 2024 18:38:21 +0900 Subject: [PATCH] Fix comments --- src/BTCPayServer.NTag424/IssuerKey.cs | 9 ++++----- src/BTCPayServer.NTag424/PICCData.cs | 12 +++++------- 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/src/BTCPayServer.NTag424/IssuerKey.cs b/src/BTCPayServer.NTag424/IssuerKey.cs index 3268822..2bb2d77 100644 --- a/src/BTCPayServer.NTag424/IssuerKey.cs +++ b/src/BTCPayServer.NTag424/IssuerKey.cs @@ -70,21 +70,20 @@ public record IssuerKey(AESKey AESKey) } /// - /// Decrypt the PICCData from the BoltCard and check the checksum. + /// Decrypt the PICCData from the BoltCard. (The checksum isn't verified) /// /// The url with p= and c= parametersThe PICCData if the checksum passed verification or null. + /// The PICCData if it has been decrypted. public BoltcardPICCData? TryDecrypt(Uri? uri) { return BoltcardPICCData.TryDecrypt(DeriveEncryptionKey(), uri); } /// - /// Decrypt the PICCData from the Boltcard and check the checksum. + /// Decrypt the PICCData from the BoltCard. (The checksum isn't verified) /// - /// The encryption key (K1) /// p= encrypted PICCData parameter - /// The PICCData if the checksum passed verification or null. + /// The PICCData if it has been decrypted. public BoltcardPICCData? TryDecrypt(string p) { return BoltcardPICCData.TryDecrypt(DeriveEncryptionKey(), p); diff --git a/src/BTCPayServer.NTag424/PICCData.cs b/src/BTCPayServer.NTag424/PICCData.cs index bccfb2b..4995b6a 100644 --- a/src/BTCPayServer.NTag424/PICCData.cs +++ b/src/BTCPayServer.NTag424/PICCData.cs @@ -25,15 +25,14 @@ public record BoltcardPICCData : PICCData /// - /// Decrypt the PICCData from the BoltCard and check the checksum. + /// Decrypt the PICCData from the BoltCard. (The checksum isn't verified) /// /// The encryption key (K1) /// The url with p= and c= parametersOptional payload committed by c - /// The PICCData if the checksum passed verification or null. + /// The PICCData if it has been decrypted. public static BoltcardPICCData? TryDecrypt(AESKey encryptionKey, Uri? uri) { - if (!ExtractPC(uri, out var p, out var c)) + if (!ExtractPC(uri, out var p, out _)) return null; return TryDecrypt(encryptionKey, p); @@ -48,12 +47,11 @@ public record BoltcardPICCData : PICCData } /// - /// Decrypt the PICCData from the Boltcard and check the checksum. + /// Decrypt the PICCData from the BoltCard. (The checksum isn't verified) /// /// The encryption key (K1) /// p= encrypted PICCData parameter - /// c= checksum parameter - /// The PICCData if the checksum passed verification or null. + /// The PICCData if it has been decrypted. public static BoltcardPICCData? TryDecrypt(AESKey encryptionKey, string p) { if (!ValidateP(p))