KSeF certificate: how to generate it, step by step
In short: you generate a KSeF certificate yourself in the free Aplikacja Podatnika KSeF (the Ministry of Finance's taxpayer app): you log in, create a key protected by a password, send a request and download the certificate. You end up with two files, a private key .key and a certificate .crt. Together with the password, you upload them to your invoicing software or store app. The certificate is valid for no more than 2 years, and a lost key or password cannot be recovered.
What a KSeF certificate is for
KSeF certificates are issued by the Certification Centre of the Polish Ministry of Finance (MF). There are two kinds, and each one is generated separately:
| Kind | What it is for | What to choose in the request |
|---|---|---|
| Type 1, authentication | Software logs in to KSeF and sends invoices | "Uwierzytelnienie w systemie KSeF" (authentication in KSeF) |
| Type 2, offline | The second QR code on an invoice issued in offline mode | "Podpis linku weryfikacyjnego wystawcy" (signing the issuer verification link) |
You cannot generate one certificate for both purposes (Podręcznik KSeF 2.0, part I, chapter 2.5.1). Invoicing software or a store app usually needs a type 1 certificate.
Important: you cannot use a KSeF certificate to log in to Aplikacja Podatnika itself. It is meant for software connected to the KSeF 2.0 API.
Who can generate a certificate
- a sole proprietor (JDG, jednoosobowa działalność gospodarcza), on their own NIP (Polish tax number),
- an individual, on their own PESEL (Polish personal ID number), if they have any permissions in KSeF (for example an employee or an accountant),
- a company, on its own NIP, after logging in with a qualified electronic seal.
Source: MF FAQ, category "Certyfikaty KSeF", question 4. The identifier the certificate is issued for (NIP or PESEL) depends on the login method and the identifier it contains. For an individual, KSeF takes the link between NIP and PESEL into account, so the certificate works within the permissions granted on both numbers.
A certificate with an individual's data is personal. MF does not allow you to pass it to another person, for example your accountant (MF FAQ, category "Certyfikaty KSeF", question 8). Your accountant gets separate KSeF permissions.
What you need
- a way to log in through login.gov.pl (Profil Zaufany, mObywatel, online banking, e-ID card) or a qualified electronic signature,
- your company NIP,
- a place on your disk to save two files,
- a password for the key, stored in a password manager,
- about 10 minutes.
Step by step in Aplikacja Podatnika KSeF
We give button and field names as in the user manual for Aplikacja Podatnika KSeF 2.0 (version 2.6, August 2026). The labels are in Polish, so we quote them in Polish with a translation. The screens may look slightly different after updates.
1. Log in
Go to ap.ksef.mf.gov.pl. Choose "Zaloguj przez login.gov.pl" (log in via login.gov.pl) or "Zaloguj certyfikatem" (log in with a qualified certificate). Then choose the context: as the identifier select the entity's NIP, enter your company NIP and click "Przejdź dalej" (continue). Confirm your identity.
With a qualified signature, the app asks you to download an "żądanie autoryzacyjne" (authorisation request), sign it and upload it back as an .xml or .xades file.
2. Open the certificate request
In the left menu choose "Wnioskuj o certyfikat" (request a certificate). You can open the same request from "Lista certyfikatów" (list of certificates) with the "Wnioskuj o certyfikat" button.
3. Enter the certificate name
In the "Nazwa certyfikatu" (certificate name) field, enter a name you will recognise on the list. Both files will also be saved under this name. Rules: 5 to 100 characters, Polish letters, digits, spaces and the characters - and _.
A good name says where the certificate will be used and from when, for example Sklep faktury 2026-11. If you use several programs, this makes it easier to revoke the right one.
4. Set the key password
In "Hasło" (password) and "Powtórz hasło" (repeat password), set the password that protects the private key. The password must have:
- 15 to 32 characters,
- an upper-case and a lower-case letter without Polish characters,
- a digit,
- one of the special characters
! @ # $ % ^ & * ( ) - _ = +.
The password cannot be reset. Save it in a password manager straight away.
5. Generate the key
Click "Generuj" (generate). The app creates a key pair and immediately saves the private key on your computer as a .key file (for example Sklep faktury 2026-11.key). Check your downloads folder before you go on.
6. Choose the purpose and the date
On the "Przesłanie wniosku" (sending the request) screen:
- in "Przeznaczenie certyfikatu" (certificate purpose), choose "Uwierzytelnienie w systemie KSeF" (for software or a store app) or "Podpis linku weryfikacyjnego wystawcy" (for offline invoices),
- in "Certyfikat ważny od" (valid from), choose the start date. The certificate is valid for 2 years from that date and cannot be used before it.
Click "Wyślij wniosek o wydanie certyfikatu" (send the certificate request).
7. Download the certificate
The app shows a progress screen. Click "Odśwież" (refresh) until you see that the certificate has been issued. Then click "Pobierz certyfikat" (download certificate). A .crt file in PEM format is saved.
If you close this screen, nothing is lost: you can download the certificate later from "Lista certyfikatów" (select it and choose "Pobierz certyfikat", PEM format). Only a certificate with the status "Aktywny" (active) can be downloaded.
The .crt and .key files: what they are and where to keep them
| File | What it contains | Can you download it again? |
|---|---|---|
.crt |
The certificate with the public key and your data | Yes, from Lista certyfikatów |
.key |
The private key, encrypted with your password | No, it exists only on your side |
MF states clearly that only the user holds the private key and that it cannot be recovered from KSeF. Without the key, a re-downloaded .crt is useless (user manual, chapter 5.7.2.1). So:
- make a copy of both files in a safe place, for example an encrypted drive,
- do not send the key and the password through the same channel, for example in one e-mail,
- if the key leaks, revoke the certificate at once.
Validity and renewal
A KSeF certificate is valid for no longer than 2 years from the date of issue or from the start date given in the request (§ 6(2) of the regulation on using KSeF; MF FAQ, category "Certyfikaty KSeF", question 2). Example from the MF manual: a request filed on 15 February 2026 with a start date of 1 March 2026 gives a certificate valid for 2 years from 1 March 2026.
Renewal is simply a new request. MF recommends setting its start date to the day after the current certificate expires. You can get a new certificate no earlier than one month before the oldest active certificate expires (Podręcznik KSeF 2.0, part I, chapter 2.5.6). Put the expiry date in your calendar well in advance, because after expiry your software will stop sending invoices.
There are also limits. On a PESEL you can have 6 active certificates and 6 new ones waiting to start; on an individual's NIP, 100 and 100. For a small business this makes no practical difference.
Changing permissions does not revoke a certificate. An accountant whose access was removed by one client still has a valid certificate for working for the others (MF FAQ, category "Certyfikaty KSeF", question 10).
How to upload the certificate to software or a store app
Most programs ask for the same three things: the .crt file, the .key file and the key password. A certificate works only in the environment where you generated it, so for a trial run generate a separate one in the KSeF test environment or Demo. In the KSeF Faktury app for Shopify you do this in the "Connect your store to KSeF" step: you add the certificate and key, enter the password and click "Save and test connection". We do not store the password; it is only used to read the key. How we store the certificate is described on the Security page, and the whole process on the home page in the How it works section.
How to revoke a certificate
In "Lista certyfikatów", select the certificate, click "Unieważnij" (revoke), choose a reason and confirm with "Unieważnij certyfikat". The available reasons are: replaced by a new certificate, private key compromised, or unspecified. The certificate gets the status "Zablokowany" (blocked, revocation in progress) or straight away "Unieważniony" (revoked). You can only revoke your own certificates, one at a time.
Common mistakes
| Problem | Cause | What to do |
|---|---|---|
| Software rejects the password | Typo, or a different password from the one used when generating | The password cannot be recovered: revoke the certificate and generate a new one |
There is no .key file |
The browser blocked the download or the file was deleted | The key cannot be recovered: file a new request |
| Software does not connect to KSeF | The purpose "Podpis linku weryfikacyjnego wystawcy" was chosen, or the certificate comes from another environment (test, Demo, production) | Logging in software needs an "Uwierzytelnienie w systemie KSeF" certificate |
| Certificate does not work although issued | The "Certyfikat ważny od" date is in the future | Wait until that date or file a new request with today's date |
| Invoices stopped going out | The certificate has expired | New request and upload of the new files |
| You cannot see the company's invoices | Logged in in the wrong context, or no permissions on your PESEL | Log in in the context of the company NIP, check permissions |
Questions and answers
How much does a KSeF certificate cost?
You file the request in the free Aplikacja Podatnika KSeF. The Ministry does not require any paid software for this.
Certificate or token?
Both work side by side (MF FAQ, category "Certyfikaty KSeF", question 3). Today a token works until it is revoked (MF is considering a validity of 1-365 days), it carries its permissions and works in only one context. You will find a comparison in the article on the KSeF token.
Can I have several certificates?
Yes, within the limits. It is worth having a separate certificate for each program, so you can revoke one without switching off the others.
I am a sole proprietor (JDG). Can my accountant use my certificate?
No. A certificate issued to an individual may only be used by that person. Grant your accountant permissions in KSeF, and they will generate their own certificate. See also KSeF for sole proprietors (JDG) step by step.
Sources
- Podręcznik użytkownika Aplikacji Podatnika KSeF 2.0, wersja 2.6, sierpień 2026 (user manual), chapters 4.1, 5.1, 5.7
- Podręcznik KSeF 2.0, cz. I: rozpoczęcie korzystania z KSeF (06.08.2026) (KSeF manual, part I), chapter 2.5
- Pytania i odpowiedzi KSeF 2.0 (MF FAQ): category "Certyfikaty KSeF", questions 1-4, 7, 8, 10
- Rozporządzenie MFiG z 12 grudnia 2025 r. w sprawie korzystania z KSeF, Dz.U. 2025 poz. 1815 (regulation on using KSeF), § 6, amended by Dz.U. 2026 poz. 169
- Aplikacja Podatnika KSeF 2.0, Ministry of Finance
Legal status as of 23 October 2026.
This article is general information and is not tax advice.