What Is a BKS File? How to Open Bouncy Castle Keystores
A BKS file is a Bouncy Castle keystore that starts with the bytes 00 00 00 02. Jump to your question below, or work through it in order.
What Is a BKS File? Bouncy Castle keystores, and an old NTBackup list
Short answer
BKS files are Bouncy Castle keystores: one password-protected file with certificates and encrypted private keys inside. Java programs read them, and so do Android apps.
Version 2 files start with the bytes 00 00 00 02. In our test, the file command printed only the word data for all 15 of our BKS and UBER files, so read the first bytes yourself.
A wrong password and one changed byte give the same error message. Check which kind of BKS file you have before you try more passwords. The ending also names an old NTBackup list of files to save.
BKS files are keystores from the Bouncy Castle cryptography library. One file contains certificates and encrypted private keys, and a password locks it.
Picture a folder with keystore.bks inside. You double-click it, and nothing opens. Java's own keytool says BKS not found. Most BKS file questions start right there.
Bouncy Castle offers cryptography tools for Java and C#, says Wikipedia. The Legion of the Bouncy Castle, an Australian charity, looks after it. FILExt describes BKS files as Bouncy Castle keystores for public keys, certificates and private keys.
FILExt says about 55 percent of its BKS samples start with 00 00 00 02 and about 20 percent start with 00 00 00 01. Its median BKS file is about 2 KB. The common names are keystore.bks, grs_sp.bks and updatesdkcas.bks.
A few other things use the ending, and one of them is an old Windows list of files to back up. The section on other meanings covers them.
BKS file facts at a glance
| Property | Value |
|---|---|
| File extension | .bks |
| Made by | The Bouncy Castle library, in Java or C# code |
| Contains | Certificates, public keys and encrypted private keys |
| Protected by | A password that checks the BKS file and locks the private keys |
| Version 2 starts with |
The bytes 00 00 00 02 00 00 00 14
|
| Opens in | keytool with the Bouncy Castle provider, or Python with pyjks |
| Other meaning | An NTBackup list of files to save, which is a text file |
Wrong page? Windows backups that end in .bkf are in the BKF file guide. Java Web Start files that end in .jnlp are in the JNLP file guide.
Which Kind of BKS File Do You Have? Read the first eight bytes, then check the folder
Read the first eight bytes of your BKS file. Version 2 BKS files start 00 00 00 02 00 00 00 14. JKS files start fe ed fe ed, and PKCS12 and BCFKS files start 30 82.
BKS files can be tiny or big, so read only the start. The short script below does that and prints one line. Save it as check_bks.py and replace keystore.bks with your BKS file name.
import struct, sys
data = open(sys.argv[1], "rb").read()
head = data[:8]
if head[:4] == b"\xfe\xed\xfe\xed":
print("JKS: a Java KeyStore, not a BKS file")
elif head[:2] == b"\x30\x82":
print("DER data: PKCS12 or BCFKS, not a BKS file")
elif head[:3] == b"\0\0\0" and head[3] in (1, 2) and head[4:] == b"\0\0\0\x14":
count = struct.unpack(">i", data[28:32])[0]
print("Version", head[3], "| iterations", count, "| size", len(data), "bytes")
if head[3] == 1:
print("Version 1: an older BKS file or a UBER file. The start does not show which.")
elif head[:2] in (b"\xff\xfe", b"\xfe\xff") or head[:3] == b"\xef\xbb\xbf":
print("Text with a byte order mark: maybe an NTBackup selection list")
else:
print("First bytes", head.hex(" "), "- not a keystore")
python check_bks.py keystore.bks
Version 2 | iterations 1992 | size 2919 bytes
We ran it on all 18 test files, and it named every kind correctly. It reads only the start, so a cut or changed BKS file still reads as version 2. The table shows the starts it knows.
| Kind | First bytes | Opens in |
|---|---|---|
| BKS version 2 |
00 00 00 02 00 00 00 14
|
keytool with Bouncy Castle, or pyjks |
| BKS version 1 or UBER |
00 00 00 01 00 00 00 14
|
keytool with the BKS or UBER type |
| JKS |
fe ed fe ed
|
keytool |
| PKCS12 or BCFKS |
30 82 in our files
|
keytool |
| NTBackup selection list | Text, often a byte order mark | NTBackup or Notepad |
Three more clues besides the bytes
file command printed data for all 15 of our BKS and UBER files. It named only the JKS file. The word data is not a verdict.
What Is Inside a BKS File? A header, typed entries and a checksum
BKS version 2 files start with 32 header bytes, then entries, one zero byte and 20 checksum bytes. Aliases and certificates are readable. Private keys are encrypted.
Think of a binder with labeled pockets. Labels are aliases, and pockets store certificates or locked keys. Anyone can read the labels. Only the password opens the locks.
The 32-byte header
| Offset | Size | What it stores |
|---|---|---|
| 0 | 4 bytes | The version: 2 for version 2, and 1 for older files |
| 4 | 4 bytes | The salt length, which was 20 in all our files |
| 8 | 20 bytes | The salt, a random value that is new for every file |
| 28 | 4 bytes | The iteration count, from 1,045 to 1,992 in our files |
The salt and the count feed the password check. Every BKS file gets a new salt, so two files with the same password still look different.
The entries
After the header comes one entry after another. Every entry starts with a type byte. We saw three types in our 18 files.
| Type byte | Name | What it stores |
|---|---|---|
01
|
Trusted certificate | The alias, the date, the text X.509, the length and the certificate bytes |
04
|
Sealed key | The alias, a date, the certificate chain and the encrypted key. Private keys and secret keys both used this type. |
00
|
End marker | No more entries follow |
Certificates are stored as DER bytes, not as PEM text, so a search for BEGIN CERTIFICATE finds nothing. The alias and the text X.509 do show in a plain text viewer. The private key bytes are encrypted.
BKS files with only type 01 entries work as truststores, like our 127-certificate bundle. Files with type 04 entries are keystores in the full sense, because they store keys.
00 00 00 02 00 00 00 14 version 2, salt length 20
67 24 ed c9 92 55 5c 3f 85 f3 1c 59 36 1b a1 fa salt, first 16 of 20 bytes
87 a6 15 89 salt, last 4 bytes
00 00 06 d4 1,748 iterations
00 end marker, no entries
a6 76 12 c5 b0 a9 d2 ce f0 50 d4 1b 2e db a4 19 checksum, first 16 of 20 bytes
4b 15 c4 47 checksum, last 4 bytes
The 20-byte checksum
The last 20 bytes are the checksum, and the password creates it. Version 1 BKS files used a weak one. CERT says version 1 used a 16-bit key for it, which allows only 65,536 keys. Bouncy Castle 1.47 moved the default to version 2 with a 160-bit key.
UBER files look different inside
Bouncy Castle also offers the UBER store type, and the type named BouncyCastle made the same output in our test. Both start with 00 00 00 01. They encrypt everything after the header, so no alias shows in a text viewer. Our three UBER-type files failed when we read them as BKS.
The version byte is not enough. BKS version 1 files and UBER files both start with 00 00 00 01. The start cannot separate them. We could not make a version 1 BKS file, because Bouncy Castle 1.77 does not offer that type.
What Do 18 Test BKS Files Show? Four tools, eighteen results and one error for two causes
We made 18 test BKS files with Bouncy Castle 1.77 and read them with four tools. Java's own keytool read none. A wrong password and a changed byte gave the same error.
Real BKS files often contain private keys, so few people post them. We made our own with keytool and the real Bouncy Castle code. Every key in them is a test key. Our BKS files did not come from phones, apps or servers. We did not make or test a version 1 BKS file.
The 18 BKS files we made
| File | What it tests | Bytes |
|---|---|---|
| 01 RSA key | One RSA private key | 2,070 |
| 02 EC key | One EC private key | 518 |
| 03 one certificate | One trusted certificate | 801 |
| 04 certificate bundle | 127 certificates from a CA bundle | 144,239 |
| 05 AES key | One secret AES key | 154 |
| 06 mixed | Key pair, certificate and secret key | 2,919 |
| 07 BouncyCastle type | One RSA key in the BouncyCastle store type | 2,080 |
| 08 UBER type | The same key in the UBER store type | 2,080 |
| 09 empty | A keystore with no entries | 53 |
| 10 long password | One RSA key and a 45-character password | 2,071 |
| 11 JKS renamed | A JKS file with the .bks ending | 2,065 |
| 12 PKCS12 renamed | A PKCS12 file with the .bks ending | 2,552 |
| 13 cut in half | The mixed file cut at the middle | 1,459 |
| 14 byte changed | One byte in the middle of the mixed file changed | 2,919 |
| 15 last byte changed | The last byte, which is in the checksum, changed | 2,919 |
| 16 three keys | Three RSA key pairs | 6,102 |
| 17 UBER bundle | The 127-certificate bundle in the BouncyCastle type | 144,240 |
| 18 BCFKS | One RSA key in a BCFKS file | 2,578 |
All but one used the password changeit. The four tools were libmagic 5.45 (the Linux file command), keytool from Java 21, the same keytool with Bouncy Castle 1.77 added and pyjks 20.0.0 for Python.
How the tools read the 18 BKS files
| File | keytool with Bouncy Castle | pyjks |
|---|---|---|
| 01 RSA key | 1 entry | 1 entry |
| 02 EC key | 1 entry | 1 entry |
| 03 one certificate | 1 entry | 1 entry |
| 04 bundle | 127 entries | 127 entries |
| 05 AES key | 1 entry | 1 entry |
| 06 mixed | 3 entries | 3 entries |
| 07 BouncyCastle | UBER: 1 entry | Error: alias text |
| 08 UBER | UBER: 1 entry | Error: alias text |
| 09 empty | 0 entries | 0 entries |
| 10 long password | 1 entry | 1 entry |
| 11 JKS renamed | Error: version | Error: version |
| 12 PKCS12 renamed | Error: version | Error: version |
| 13 cut in half | Error: EOF | Error: too short |
| 14 byte changed | Error: integrity | Error: hash |
| 15 last byte changed | Error: integrity | Error: hash |
| 16 three keys | 3 entries | 3 entries |
| 17 UBER bundle | UBER: 127 entries | Error: alias text |
| 18 BCFKS | BCFKS: 1 entry | Error: version |
In the table, version means Wrong version of key store. EOF means the file ended early. Integrity means KeyStore integrity check failed, hash means a hash mismatch and alias text means unreadable alias bytes. Java 21 keytool with no extras printed BKS not found for all 18 files. The file command printed data for 16 of them, including every BKS and UBER file. It named the JKS file Java KeyStore and gave the BCFKS file an odd label. We read UBER files as UBER and the BCFKS file as BCFKS, and every other file as BKS.
What the 18 results say about BKS files
Read the results with care. These files came from one library version and one Java version. Keystores from phones and servers may use other counts and bigger chains. The results show how tools behave, not how common any case is.
Repeat the check on your own file
The first bytes script reads any file you give it. The steps to open a BKS file list the entries without changing anything.
What Does Our Expert Say About BKS Files? A note from Neeraj Singh on a failed password check
Read the first eight bytes, list the aliases with no password, then test the password on a copy. The error message alone will not show what is wrong.
Expert insight
“A BKS file that will not open is rarely broken. In our tests, a wrong password and one changed byte gave the same message: KeyStore integrity check failed. That message does not show which one went wrong. So I list the aliases with no password first. If they show, the structure reads fine. Then the password is the next suspect. Try your password on a copy before you call the BKS file damaged.”
What one error message cannot separate
The check at the end of BKS files comes from their contents and the password. Wrong passwords fail it, and so does one changed byte. The error text is the same in both cases, so guessing passwords on damaged BKS files wastes time.
The list with no password skips the check. In our test it showed the aliases of both changed files. It also showed a different certificate fingerprint for the file with the changed middle byte. Fingerprints let you compare copies with originals.
Test on a copy. Make a copy and try your password on the copy. If aliases show but the password still fails, compare size and fingerprints with an older copy of the BKS file.
How Do You Open a BKS File? keytool, Python or a desktop app
Open BKS files with keytool and the Bouncy Castle provider, or with pyjks in Python. Java's own keytool cannot read them. A password is needed for the keys and for the check.
Double-clicks get you nowhere, because BKS files are not documents. Check the first eight bytes first. The steps below fit version 2 files, which start with 00 00 00 02.
Open a BKS file with keytool
- Download the bcprov jar from the Bouncy Castle project. We used version 1.77. Save it next to your BKS file and call it bcprov.jar.
- Open a terminal in that folder. keytool comes with the Java JDK.
- Enter the command below. Replace keystore.bks with your BKS file name and changeit with your password.
- Read the answer. Entries show their alias, date and type. Certificate entries add a SHA-256 fingerprint.
- No password? Press Enter at the password prompt. keytool lists the entries and warns that it could not check the BKS file.
keytool -list -keystore keystore.bks -storetype BKS -providerclass org.bouncycastle.jce.provider.BouncyCastleProvider -providerpath bcprov.jar -storepass changeit
Keystore type: BKS
Keystore provider: BC
Your keystore contains 3 entries
aeskey, Oct 16, 2026, SecretKeyEntry,
rsakey, Oct 16, 2026, PrivateKeyEntry,
Certificate fingerprint (SHA-256): 21:BF:B3:C1:D9:2C:30:1D:01:FE:8B:C2:2A:35:E0:FF:82:59:BD:AA:29:5C:CB:C0:73:A0:FC:BD:4B:A7:43:1F
trustedca, Oct 16, 2026, trustedCertEntry,
Certificate fingerprint (SHA-256): 21:BF:B3:C1:D9:2C:30:1D:01:FE:8B:C2:2A:35:E0:FF:82:59:BD:AA:29:5C:CB:C0:73:A0:FC:BD:4B:A7:43:1F
UBER and BCFKS files need their own type. Change BKS after storetype to UBER for UBER files and to BCFKS for BCFKS files. Both worked in our test. The first bytes show which one fits.
Open a BKS file with Python
pyjks is a free Python package. Install it with pip install pyjks. The code below prints every alias and its entry type. In our test it read all nine intact version 2 files and none of the others.
import jks
ks = jks.BksKeyStore.load("keystore.bks", "changeit")
for alias, entry in ks.entries.items():
print(alias, type(entry).__name__)
trustedca BksTrustedCertEntry
aeskey BksSealedKeyEntry
rsakey BksSealedKeyEntry
Wrong passwords stop pyjks with a hash mismatch message.
Apps that open BKS files
Why Will a BKS File Not Open? Five causes, and only one of them is the file
When a BKS file will not open, check the Java setup, the first bytes, the store type, the password and the BKS file. Only the last check blames the BKS file.
Most failures are mismatches. The keystore is fine, and the tool does not fit it. Work through five checks before you look for another copy. The red check is the one where the file itself is wrong.
A five-step check
- Show file extensions and confirm the name ends in .bks and not in .bks.exe or .bks.zip.
- Read the first eight bytes. If they are not 00 00 00 02 or 00 00 00 01, stop and read the list of rarer BKS kinds.
- Copy the BKS file to a second folder and work on the copy.
- List the entries with no password. Aliases that show prove the structure is readable.
- Try your password on the copy. If it fails and the aliases showed, the password is the likely cause. If listing fails too, get another copy.
Test with a second reader. keytool and pyjks word the same errors differently. Our changed files gave integrity check failed in one and hash mismatch in the other. Files that fail in one tool should go through the second before you give up.
How Do You Convert a BKS File to PKCS12 or JKS? Copy the entries into a new keystore
Convert a BKS file to PKCS12 with keytool importkeystore. The entries move across, and the BKS file stays as it was. You need the password and the Bouncy Castle jar.
BKS files are not documents, so you do not save them as another type. You copy their entries into new keystores of the type you want. That keeps the keys and certificates and leaves the first BKS file alone.
| You want | Route | Status |
|---|---|---|
| PKCS12 file | keytool importkeystore with PKCS12 as the target | Tested on our files |
| JKS file | The same command with JKS as the target | Tested, with a warning |
| One certificate as PEM | keytool exportcert with the rfc option | Tested |
| Entries from a UBER file | The same command with UBER as the source type | Tested |
| A BCFKS file | The same command with BCFKS as the target | Not tested |
Convert a BKS file to PKCS12
- Copy the BKS file and keep the original safe.
- Open a terminal in the folder with bcprov.jar and the copy.
- Enter the command below. Use your own file names and passwords.
- Check the answer. It should say how many entries were imported and how many failed.
- List the new file with keytool, with no provider, to confirm the entries are there.
keytool -importkeystore -srckeystore keystore.bks -srcstoretype BKS -srcstorepass changeit \
-destkeystore keystore.p12 -deststoretype PKCS12 -deststorepass changeit \
-providerclass org.bouncycastle.jce.provider.BouncyCastleProvider -providerpath bcprov.jar -noprompt
Entry for alias rsakey successfully imported.
Import command completed: 1 entries successfully imported, 0 entries failed or cancelled
It worked on our RSA file, our AES file and our 127-certificate bundle. The private key with its certificate came across, and so did the secret key. All 127 certificates came across. A UBER file also converted when we set the source type to UBER. The new file starts with 30 82, and keytool lists it without the Bouncy Castle jar.
Convert a BKS file to JKS
Change PKCS12 to JKS after deststoretype, and the new name to keystore.jks. It worked on our RSA test file, and the new file starts with fe ed fe ed. keytool warned that JKS is proprietary and recommended PKCS12.
Export one certificate as PEM
Add the rfc option to export a certificate as text. Use the alias that the list showed. The new file starts with the line BEGIN CERTIFICATE, so any text editor opens it.
keytool -exportcert -rfc -alias rsakey -keystore keystore.bks -storetype BKS -storepass changeit \
-providerclass org.bouncycastle.jce.provider.BouncyCastleProvider -providerpath bcprov.jar -file rsakey.pem
Be careful with upload sites. BKS files can contain private keys. Do not upload them to sites that promise online conversion. Use keytool on your own computer.
Is a BKS File an NTBackup Backup? Not a backup, a list of what to back up
NTBackup BKS files are backup selection lists. They name the files and folders to save. They store no backup data, and the backup itself is a BKF file.
NTBackup also worked from a command line. Microsoft's ntbackup page shows the call with an at sign before the file name. It calls these BKS files backup selection files and says you must create them in the graphical version of Backup.
Other sites agree. FileInfo calls it an NTBackup settings file with plain text lists of folders and files. The file-extensions.org entry calls it a scheduled backup script from Windows NT and 2000 and marks the entry obsolete. It adds that text editors can view it.
| Source | What it says |
|---|---|
| Microsoft | A backup selection file. Create it in the graphical Backup program, then pass it to ntbackup with an at sign. |
| FileInfo | Plain text lists of folders and files. Can include or exclude items and can ask for a system state backup. |
| file-extensions.org | Scheduled backup script from Windows NT and 2000. Text editors can view it. |
| Covington | NTBackup wanted 16-bit little-endian Unicode with no byte order mark. A Windows XP copy did the same. |
| mysysadmintips | Hand-made ANSI files made a scheduled job fail with blank logs. Saving as Unicode fixed it. |
| Cadzow | One line about an Exchange recovery group made NTBackup say it could not find the BKS file. Removing the line fixed it. |
The last three rows are user reports from Covington Innovations, mysysadmintips and Cadzow. We did not repeat any of them, because we could not use NTBackup.
The encoding trap
The reports disagree about how to save the BKS file. The sources call it plain text, and they also say Unicode. Both can be true, because UTF-16 is text. We saved the same two lines of folder paths five ways and checked them.
| Our test file | First bytes | file command |
|---|---|---|
| UTF-16 little-endian, no mark |
43 00 3a 00
|
data |
| UTF-16 little-endian, with mark |
ff fe 43 00
|
UTF-16 little-endian text |
| UTF-16 big-endian, with mark |
fe ff 00 43
|
UTF-16 big-endian text |
| ANSI |
43 3a 5c 44
|
ASCII text |
| UTF-8, with mark |
ef bb bf 43
|
UTF-8 text with BOM |
Covington reports that the first kind worked and that a mark made NTBackup reject the file. The file command cannot name that kind. Our five files did not come from NTBackup, and we could not test which one it accepts. If lists fail, check the encoding first.
Open an NTBackup BKS file
- Read the first bytes. Text means a list and not a keystore.
- Copy the BKS file, then open the copy in Notepad.
- Read the lines. Lines are folder or file paths, and Cadzow shows that they can also name server items.
- Covington's fix was to save as Unicode in Notepad and delete the first two bytes with a hex editor. We did not test it.
Find the backup the list made
The list only names what to save. The backup it creates is a BKF file, and the BKF guide for NTBackup archives explains how to open one. These three pages describe viewers and Microsoft's command.
SysTools says its viewer has Quick, Deep and Range Based scan modes and previews files for free. Freeviewer says the same three modes exist and that its demo only previews BKF and ZIP files. Both say saving needs the paid version. We tested neither.
Is It Safe To Open a BKS File? The file is data, and the risk is the keys inside
BKS files are data, not programs. The risk is the private keys inside. Anyone can list the aliases and certificates, and only the password protects the keys.
We listed our mixed test file with no password. keytool showed three aliases, their types and the certificate fingerprints. It warned that it could not check the BKS file. So the names inside a keystore are not secret.
What a stranger can and cannot see
A safety check before you open it
- Show file extensions. Names like keystore.bks.exe are programs, so read the EXE program file guide and do not open it.
- Check the source. BKS files from your own project are expected. One in an unexpected message needs care.
- Read the first bytes. That step is safe, because nothing starts.
- List the entries on a copy, with no password, to see what the BKS file contains.
- Convert it to PKCS12 on your own computer if you need a newer format, then delete extra copies.
- Never upload BKS files to websites. Change the password if any copy ever left your hands.
Safe to read, careful to share. Reading eight bytes is safe, and so is listing the aliases. The danger starts when the BKS file and its password reach someone else.
How Does a BKS File Differ From JKS, PKCS12 and UBER? Similar jobs, different starts
BKS files are Bouncy Castle keystores, UBER files are Bouncy Castle keystores that hide the aliases, JKS files are older Java keystores and PKCS12 files are the common standard. They need different settings.
Several keystore types look alike. The table sorts them by what they are and by the bytes they start with. Mix them up and keytool answers with Wrong version of key store.
| Type | What it is | First bytes |
|---|---|---|
| BKS version 2 | A Bouncy Castle keystore. Aliases are readable and keys are encrypted. |
00 00 00 02
|
| UBER | A Bouncy Castle keystore encrypted in full after the header. No alias shows. |
00 00 00 01
|
| JKS | The older Java keystore. keytool calls the format proprietary. |
fe ed fe ed
|
| PKCS12 | keytool calls it the industry standard format. Java 21 keytool opened our file. |
30 82 in our file
|
| BCFKS | Another Bouncy Castle type. keytool listed our file as BCFKS. |
30 82 in our file
|
Java 21 keytool reads JKS and PKCS12 without extras. It does not read BKS, UBER or BCFKS until you add the Bouncy Castle jar. That is the main practical difference.
The first bytes of PKCS12 and BCFKS can match, so keytool is the better test for those two. Try every type name until the list opens. A wrong guess costs nothing, because keytool only reads the BKS file.
Wrong page? ZIP files with the .bks name may be Capego year-end exports, and the ZIP file guide shows how to open it.
What Else Does the BKS Ending Mean? A backup list, a spreadsheet and a few more
Other things use the BKS ending too. The best known is the NTBackup selection list. Spreadsheet backups, IBM bookshelves and a Swedish accounting export also appear.
If your BKS file does not start with 00 00 00 02 or 00 00 00 01, it may be none of the keystore kinds. Three sites list other meanings, and the table shows what they say.
| Meaning | What it is | Where it comes from |
|---|---|---|
| NTBackup selection list | A text list of folders and files to back up | Windows NT, 2000 and XP. NTBackup opens it. |
| Microsoft Works spreadsheet backup | WPS file with the .bks ending. FileInfo says to rename it to .wps. | A Works folder. Works or Excel opens it. |
| IBM BookManager bookshelf | Bookshelf backup, or book for Softcopy Reader | IBM BookManager READ |
| Capego Bokslut export | A ZIP archive for year-end audits, from Wolters Kluwer in Sweden, says FILExt | Capego accounting software |
| No fixed format | FILExt says about 25 percent of its BKS samples have other starts, and it names ZIP and GZIP among them | Unknown |
The file-extensions.org list names five BKS records: Works backups, two IBM BookManager records, Windows scheduled backup scripts and NTBackup settings. The FILExt page names the Bouncy Castle keystore, the NTBackup script, BookManager, Capego and the Works backup.
We found no public sample of the Works, BookManager or Capego kinds, so we say nothing about their bytes. All three sites are directories, and none of them explains how it counted.
What Is the BKS File Format Made Of? The specification facts we could check
BKS version 2 files have 32 header bytes, typed entries, a zero end marker and 20 checksum bytes. Version 1 and UBER files start with 00 00 00 01 instead.
| Item | What we could check |
|---|---|
| Maker | The Bouncy Castle library, which Wikipedia describes as cryptography tools for Java and C# |
| Name | Bouncy Castle keystore, according to FILExt |
| Versions | Versions 1 and 2. Version 2 has been the default since Bouncy Castle 1.47, says CERT. |
| Signature |
00 00 00 02 00 00 00 14 for version 2 in our files, and 00 00 00 01 00 00 00 14 for version 1 and UBER files
|
| Header | 32 bytes in our files: version, salt length, a 20-byte salt and the iteration count |
| Iterations | 1,045 to 1,992 in our files |
| Entry types |
01 trusted certificate, 04 sealed key and 00 end marker in our files
|
| Certificates | X.509 certificates stored as DER bytes, with the text X.509 before them |
| Checksum | 20 bytes at the end of the BKS file, made from the contents and the password |
| Readable parts | Aliases and certificates in version 2. Nothing in UBER files after the header. |
| Media type | None that we could confirm, so we list none |
About the file signature
The first four bytes separate version 2 from the rest, and the next four were 00 00 00 14 in all 15 of our BKS and UBER files. FILExt lists the same two starts as the most common. We did not find a media type for BKS files that we could confirm.
What we left out
We did not read the Bouncy Castle source code. The layout above comes from our own 18 files, and keytool and pyjks agreed with it. We made no version 1 BKS file, because Bouncy Castle 1.77 does not offer that type.
We did not use NTBackup, KeyStore Explorer, Portecle, SysTools BKF Viewer or Freeviewer BKF Viewer. All 18 keystores and all five selection lists are ours. None came from a phone, an app or NTBackup. So we say nothing about those files beyond what the cited pages state.
We also found no Android page that lists BKS, so the only source for Android is the CERT note. We did not test the Works, BookManager or Capego kinds.
Sources checked
For the format, the Wikipedia entry on Bouncy Castle, the CERT note on version 1 files and the CVE-2018-5382 record. For the NTBackup list, Microsoft page on the ntbackup command and the Wikipedia entry on NTBackup.
For the endings, FileInfo's BKS entry. For user reports, the posts by Covington, mysysadmintips and Cadzow linked above. Every test count came from our own tests in October 2026.
Frequently Asked Questions About BKS Files
What is a BKS file?
A BKS file is a Bouncy Castle keystore. It stores certificates and encrypted private keys in one password-protected file, and Java programs read it. Version 2 files start with the bytes 00 00 00 02. The ending also names an old NTBackup list of files to back up.
What does BKS stand for?
BKS stands for Bouncy Castle keystore, according to FILExt. Bouncy Castle is a set of cryptography tools for Java and C#. The same letters also name an NTBackup selection list, but that file has nothing to do with Bouncy Castle.
How do I open a BKS file?
Read the first eight bytes first. For a version 2 file, download the Bouncy Castle bcprov jar and use keytool with the list option, the BKS store type and the providerclass and providerpath options. Python can read it too with the pyjks package.
What program opens a BKS file?
keytool opens it once you add the Bouncy Castle provider, and pyjks opens it in Python. Portecle says it opens BKS and UBER files, and file.org names KeyStore Explorer. A text start means an NTBackup list instead, and Notepad opens that.
Why does keytool say BKS not found?
Java does not include the BKS type. In our test, keytool from Java 21 printed BKS not found for all 18 files. Add the Bouncy Castle jar with the providerclass and providerpath options and try again.
What does "KeyStore integrity check failed" mean?
It means the password or the BKS file is wrong. In our test, wrong passwords and one changed byte gave the same message. List the entries with no password to see whether the structure reads, then try your password on a copy.
Can I see what is inside a BKS file without the password?
Yes, in part. keytool listed aliases, entry types and certificate fingerprints of our test files with no password. It warned that it could not check the file. The private keys stay encrypted.
Can I convert a BKS file to PKCS12 or JKS?
Yes. Use keytool with the importkeystore option, BKS as the source type and PKCS12 or JKS as the target type. It worked on our RSA, AES and 127-certificate files. Keep the original file, and never use an upload site.
How do I know which kind of BKS file I have?
Read its first eight bytes. Version 2 files start 00 00 00 02 00 00 00 14. Version 1 and UBER files start 00 00 00 01 00 00 00 14. JKS files start fe ed fe ed, and PKCS12 and BCFKS files start 30 82.
Is a BKS file safe to open?
BKS files are data, not programs. Listing entries is safe, but anyone can read aliases and certificates. Treat the BKS file and its password like the keys inside. Check that the name does not end in .exe, and never upload it to a website.
Is a BKS file an NTBackup backup?
Not the backup itself. NTBackup BKS files are text lists of files and folders to back up. The backup they make is a BKF file. Notepad opens the list, and the BKF file needs NTBackup or a viewer.
What is the difference between BKS and JKS?
Both are Java keystores. BKS comes from Bouncy Castle and starts with 00 00 00 02. JKS is the older Java format and starts with fe ed fe ed. Java 21 keytool reads JKS by itself but needs the Bouncy Castle jar for BKS.
Still Stuck With a BKS File? Eight routes out, depending on what went wrong
Start with the five checks. The Java setup, the store type and the password explain most cases.
Go to the convert steps. One keytool command moves them to PKCS12.
Is your backup a Windows archive that ends in .bkf? The guide to NTBackup archives covers it.
Is it a Java Web Start file that ends in .jnlp? The guide to JNLP files explains it.
Does a ZIP file have the .bks name? The guide to ZIP files shows how to open one.
Does your BKS file open in Notepad and show folder paths? Read about the NTBackup selection list.
Not sure the BKS file is a BKS file at all? Compare its first bytes with the format reference, then see what 18 test BKS files show.
Is it a file type you do not know? Browse the file extension resource library, or send it to us on the submit a file type page.