XAdES is the XML signature format used when KSeF authentication is backed by a
certificate. In the SDK, XAdES belongs to authentication: it signs the
AuthTokenRequest built from a KSeF challenge and a login context.
It is not the invoice XML schema, not session encryption, and not the export package format.
What XAdES proves
During XAdES authentication, KSeF checks a signed XML document and the certificate embedded in the signature. The login context is the NIP passed to the SDK method. The authenticating subject is read from the signing certificate, for example:
- a qualified personal certificate containing PESEL or NIP;
- a qualified organization seal containing NIP;
- a KSeF-issued authentication certificate;
- a certificate recognized by fingerprint permissions;
- TEST-only self-signed certificate material.
KSeF then checks whether that subject is allowed to operate in the requested context.
SDK layers
Most applications should use with_xades() or a profile that dispatches to it:
auth = client.authentication.with_xades(
nip="5261040828",
cert=cert,
private_key=private_key,
)The helper handles the normal sequence:
- Request an authentication challenge.
- Build
AuthTokenRequestXML for the context. - Sign the XML with XAdES.
- Submit the signed XML to KSeF.
- Poll the authentication operation.
- Redeem access and refresh tokens.
Use ksef2.xades directly when you need to load certificate material yourself,
inspect signed XML, or test a low-level integration boundary.
TEST certificates
The SDK can generate TEST-only self-signed certificate material with
with_test_certificate() or lower-level helpers in ksef2.xades. That is a
development shortcut for Environment.TEST; it is not valid for DEMO or
PRODUCTION.
Related pages
- Authentication methods: See XAdES alongside token, TEST certificate, and profile authentication.
- Use XAdES helpers: Load certificate material and sign authentication XML in code.
- Certificates: Understand certificate identity, enrollment, and issued certificate types.
- Low-level authentication: Run manual authentication when signing is handled outside the high-level SDK helper.
