You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Moved cryptographic settings (`SignatureAlgorithm`, `SignaturePadding`) from the static `CredentialSettings` class to instance-level properties in the `Credential` class, ensuring thread safety and better encapsulation.
Updated `SignData` and `VerifyData` methods in `Credential` and `PrivateKey` to use instance-specific parameters. Modified `ConfigureAlgorithmForInvoicing` and `ConfigureAlgorithmForXmlDownloader` to return `ICredential` for a fluent interface.
Enhanced `ICredential` and `IPrivateKey` interfaces to support the new design. Removed unused code and updated XML documentation. Incremented version to 4.0.340.
@@ -212,19 +227,21 @@ public string GetOriginalStringByXmlString(string xmlAsString)
212
227
213
228
/// <summary>
214
229
/// Configure the Signature algorithm to do invoicing, using the donetcfdi/invoicing library.
215
-
/// The default value is HashAlgorithmName.SHA1 (used for downloading xml), call ConfigureAlgorithmForInvoicing() methost to set HashAlgorithmName.SHA256 when you need to sign invoices.
230
+
/// Sets HashAlgorithmName.SHA256 for signing invoices. Returns this for fluent interface.
/// Configure the Signature algorithm to do xml-downloader, using the donetcfdi/xml-downloader library.
224
-
/// The default value is HashAlgorithmName.SHA1 (used for downloading xml), call ConfigureAlgorithmForXmlDownloader() method to set HashAlgorithmName.SHA1 when you need to download xml.
240
+
/// Sets HashAlgorithmName.SHA1 for downloading xml. Returns this for fluent interface.
Copy file name to clipboardExpand all lines: Core/ICredential.cs
+16-5Lines changed: 16 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,5 @@
1
-
usingFiscalapi.Credentials.Common;
1
+
usingSystem.Security.Cryptography;
2
+
usingFiscalapi.Credentials.Common;
2
3
3
4
namespaceFiscalapi.Credentials.Core;
4
5
@@ -27,6 +28,16 @@ public interface ICredential
27
28
/// </summary>
28
29
CredentialTypeCredentialType{get;}
29
30
31
+
/// <summary>
32
+
/// Signature algorithm used for signing data. Default is SHA256 (for invoicing).
33
+
/// </summary>
34
+
HashAlgorithmNameSignatureAlgorithm{get;set;}
35
+
36
+
/// <summary>
37
+
/// Signature padding used for signing data. Default is Pkcs1 (used for both invoicing and XML downloader).
38
+
/// </summary>
39
+
RSASignaturePaddingSignaturePadding{get;set;}
40
+
30
41
byte[]CreatePFX();
31
42
32
43
/// <summary>
@@ -87,13 +98,13 @@ public interface ICredential
87
98
88
99
/// <summary>
89
100
/// Configure the Signature algorithm to do invoicing, using the donetcfdi/invoicing library.
90
-
/// The default value is HashAlgorithmName.SHA1 (used for downloading xml), call ConfigureAlgorithmForInvoicing() methost to set HashAlgorithmName.SHA256 when you need to sign invoices.
101
+
/// Sets HashAlgorithmName.SHA256 for signing invoices. Returns this for fluent interface.
/// Configure the Signature algorithm to do xml-downloader, using the donetcfdi/xml-downloader library.
96
-
/// The default value is HashAlgorithmName.SHA1 (used for downloading xml), call ConfigureAlgorithmForXmlDownloader() method to set HashAlgorithmName.SHA1 when you need to download xml.
107
+
/// Sets HashAlgorithmName.SHA1 for downloading xml. Returns this for fluent interface.
0 commit comments