Every signature mode
Enveloped, Enveloping, and external (detached) or internal signatures of Base64 data.
XAdES-BES electronic signatures in your .NET application – with a certificate from a file, the Windows store, a smart card or a token. Proven with Polish government gateways: e-Deklaracje, KSeF and PUESC.
dotnet add package Xades.ComponentsEnveloped, Enveloping, and external (detached) or internal signatures of Base64 data.
AddXadesComponents and IXadesSigner: configuration from appsettings.json, injection in ASP.NET Core and Worker Services.
RSA-SHA256 and RSA-SHA1, XAdES 1.3.2 with signing time and signing certificate reference.
Keys in a classic CSP and in a CNG KSP – including smart cards and USB tokens.
netstandard2.0: .NET Framework 4.6.2+ and .NET 8 or later.
Keeps the document formatting and comments; saving the file does not break the signature.
Register the components in DI – the licence number or defaults from environment variables. Use IXadesSigner to sign.
{
"XadesComponents": {
"SerialNumber": "YOUR-SERIAL-NUMBER",
"CryptType": "SHA256",
"EnvelopeType": "Enveloped"
}
}builder.Services.AddXadesComponents(
builder.Configuration.GetSection(XadesOptions.SectionName));public class DeclarationService(IXadesSigner signer)
{
// CryptType and EnvelopeType come from the configuration
public XmlDocument Sign(XmlDocument declaration, X509Certificate2 cert) =>
signer.Sign(declaration, cert);
}IXadesSigner is registered as a singleton. An invalid licence number is reported when the signer is first resolved from the container, not on the first signature. Sign(document, cert, cryptType, envelopeType) overrides the defaults for a single call.
The library is available under a commercial licence. After purchase you receive a licence number that unlocks full operation.