Explore our Bouncy Castle for Java, Java FIPS and Java LTS documentation for concise guidance and examples.
Find documentation, specifications, code examples and more to get started with Bouncy Castle for Java, Java FIPS and Java LTS.
Go directly to our API documentation for a complete specification of all classes, methods, and parameters.
Find out detailed information about the latest release and search in older release notes.
View the complete list of Certifications, supported Algorithms, Key Types, Message Digests and Expandable Output Functions, Post Quantum Algorithms CRLs, OCSP, Certificate Distribution, Certificate Enrollment Protocols and more.
Find our test packages on GitHub, they will help you quickly validate if you are on the right track
Details about our current plans and versions in progress for the Bouncy Castle Java FIPS APIs can be found on the Java FIPS Roadmap.
Find out detailed information about the latest Bouncy Castle Java, Java FIPS, and Java LTS releases here:
Release notes for Bouncy Castle Java
This is the documentation, specifications, code examples, and more for the Bouncy Castle Java, Java FIPS and LTS APIs.
The Bouncy Castle Crypto package is a Java implementation of cryptographic algorithms and cryptographic protocols that make use of the algorithms.
The package is organized so that it contains a low-level lightweight API suitable for use in any environment with additional infrastructure built on top of that to construct a provider conforming to the JCA framework.
Each distribution is built around a provider jar and includes extra jars for supporting X.509, PKIX, JavaMail, JakartaMail, OpenPGP, TLS, and MLS.
Except where otherwise stated, this software is distributed under LICENSE. The OpenPGP library and the MLS library both make use of additional open-source code, see Third Party Licenses.
Disclaimer: Currently, we have no knowledge of any patents that impact the Bouncy Castle APIs which require disclosure. Patent applicability does vary from country to country and users of the library are responsible for understanding the legal landscape in their own jurisdiction.
That said, patent holders who wish to alert us to possible issues that may affect our user community are welcome to contact us via feedback-crypto@bouncycastle.org if they would like a disclosure notice included here.
The complete Specification and lists of Certifications, Supported Algorithms, Key Types, Message Digests and Expandable Output Functions, Post Quantum Algorithms CRLs, OCSP, Certificate Distribution, Certificate Enrollment Protocols and more, can be found here
Note: the Bouncy Castle Specifications can be found on the Specification and Interoperability page.
java.lang.SecurityException: Unsupported keysize or algorithm parameters at javax.crypto.Cipher.init(DashoA6275)
Package | View online | Download |
---|---|---|
Provider | bcprov-jdk18on-javadoc | bcprov-jdk18on-javadoc.jar |
ASN.1 and Utilities | bcutil-jdk18on-javadoc | bcutil-jdk18on-javadoc.jar |
PKIX/CMS/EAC/DVCS/PKCS/TSP/OPENSSL | bcpkix-jdk18on-javadoc | bcpkix-jdk18on-javadoc.jar |
OpenPGP | bcpg-jdk18on-javadoc | bcpg-jdk18on-javadoc.jar |
S/MIME | bcmail-jdk18on-javadoc | bcmail-jdk18on-javadoc.jar |
DTLS/TLS and JSSE Provider | bctls-jdk18on-javadoc | bctls-jdk18on-javadoc.jar |
Package | View online | Download |
---|---|---|
Provider | bcprov-jdk15to18-javadoc | bcprov-jdk15to18-javadoc.jar |
ASN.1 and Utilities | bcutil-jdk15to18-javadoc | bcutil-jdk15to18-javadoc.jar |
PKIX/CMS/EAC/DVCS/PKCS/TSP/OPENSSL | bcpkix-jdk15to18-javadoc | bcpkix-jdk15to18-javadoc.jar |
OpenPGP | bcpg-jdk15to18-javadoc | bcpg-jdk15to18-javadoc.jar |
S/MIME | bcmail-jdk15to18-javadoc | bcmail-jdk15to18-javadoc.jar |
DTLS/TLS and JSSE Provider | bctls-jdk15to18-javadoc | bctls-jdk15to18-javadoc.jar |
Package | View online | Download |
---|---|---|
Provider | bcprov-jdk14-javadoc | bcprov-jdk14-javadoc.jar |
ASN.1 and Utilities | bcutil-jdk14-javadoc | bcutil-jdk14-javadoc.jar |
PKIX/CMS/EAC/DVCS/PKCS/TSP/OPENSSL | bcpkix-jdk14-javadoc | bcpkix-jdk14-javadoc.jar |
OpenPGP | bcpg-jdk14-javadoc | bcpg-jdk14-javadoc.jar |
S/MIME | bcmail-jdk14-javadoc | bcmail-jdk14-javadoc.jar |
Package | View online | Download |
---|---|---|
Provider | bcprov-jdk13-javadoc | bcprov-jdk13-javadoc.jar |
ASN.1 and Utilities | bcutil-jdk13-javadoc | bcutil-jdk13-javadoc.jar |
PKIX/CMS/EAC/DVCS/PKCS/TSP/OPENSSL | bcpkix-jdk13-javadoc | bcpkix-jdk13-javadoc.jar |
OpenPGP | bcpg-jdk13-javadoc | bcpg-jdk13-javadoc.jar |
S/MIME | bcmail-jdk13-javadoc | bcmail-jdk13-javadoc.jar |
While there are some example packages for the Bouncy Castle Java distribution, the best place to find examples of use for the different features available in the Bouncy Castle APIs is in the different test packages written to exercise those features.
To view some examples, look at the test programs in the packages on GitHub:
There are also some specific example programs for dealing with Attribute Certificates, PKCS12, SMIME, and OpenPGP. They can be found on GitHub:
Finally, you can download some code examples from Beginning Cryptography with Java which demonstrate both the use of the JCE/JCA and some of the Bouncy Castle APIs such as for certificate generation, CMS, and S/MIME. Note: the book was written to cover J2SE 5.0, while many of the examples will work with earlier JDKs, some will not compile if you are not using J2SE 5.0 or later.
Unfortunately, some examples in the book are now out of date (for 1.46 and above). You can also find more up-to-date documentation and examples in Java Cryptography: Tools and Techniques. A copy of the source code for the examples in the book can be downloaded here: java-crypto-tools-src.zip.
To verify the packages, run the following Java programs with the appropriate classpath:
Here you can find Bouncy Castle Java FIPS-specific documentation. If you can't find what you're looking for here, please see the general Bouncy Castle Java documentation above.
Package | View online | Download |
---|---|---|
BC FIPS | bc-fips-1.0.2.4-javadoc | bc-fips-1.0.2.4-javadoc.jar |
CMS/EAC/OCSP/PKIX/PKCS/TSP | bcpkix-fips-1.0.7-javadoc | bcpkix-fips-1.0.7-javadoc.jar |
S/MIME | bcmail-fips-1.0.4-javadoc | bcmail-fips-1.0.4-javadoc.jar |
S/MIME (Jakarta) | bcjmail-fips-1.0.4-javadoc | bcjmail-fips-1.0.4-javadoc.jar |
OpenPGP/BCPG | bcpg-fips-1.0.7.1-javadoc | bcpg-fips-1.0.7.1-javadoc.jar |
TLS | bctls-fips-1.0.18-javadoc | bctls-fips-1.0.18-javadoc.jar |
Post-Quantum add-on | bcpqc-addon-fips-1.0.1-javadoc | bcpqc-addon-fips-1.0.1-javadoc.jar |
Latest releases
Security Policy | BC-FJA-SecurityPolicy-2.1.0.pdf |
Known Issues | Download file: BC-FJA-KnownIssues-2.1.0.csv |
User Guides | BC-FJA-UserGuide-2.1.0.pdf |
BC-FJA-(D)TLSUserGuide-2.1.20.pdf |
Security Policy | BC-FJA-SecurityPolicy-2.0.0.pdf |
Known Issues | Download file: BC-FJA-KnownIssues-2.0.0.csv |
User Guides | BC-FJA-UserGuide-2.0.0.pdf |
BC-FJA-(D)TLSUserGuide-2.0.20.pdf |
Find examples of how to use the different features in the Bouncy Castle APIs in the test packages.
BC FIPS in 100 mini-book | BCFipsIn100.pdf |
BC FIPS in 100 examples | Download: bc-fips-100-java.tar.gz or bc-fips-100-java.zip |
Default DRBG provider built on FIPS module (src + sample jar) | Download: bcdefdrbg-fips-1.0.1.zip |
Here you can find Bouncy Castle Java LTS-specific documentation. If you can't find what you're looking for, please see the general Bouncy Castle Java documentation above.
Furthermore, the LTS project extends its support beyond Java, offering acceleration for Intel and ARM architectures where the underlying operating system allows for it.
Package | View online | Download |
---|---|---|
Provider | bcprov-lts8on-2.73.5-javadoc | bcprov-lts8on-2.73.5-javadoc.jar |
Utility Classes | bcutil-lts8on-2.73.5-javadoc | bcutil-lts8on-2.73.5-javadoc.jar |
CMS/EAC/OCSP/PKIX/PKCS/TSP | bcpkix-lts8on-2.73.5-javadoc | bcpkix-lts8on-2.73.5-javadoc.jar |
S/MIME | bcmail-lts8on-2.73.5-javadoc | bcmail-lts8on-2.73.5-javadoc.jar |
S/MIME (Jakarta) | bcjmail-lts8on-2.73.5-javadoc | bcjmail-lts8on-2.73.5-javadoc.jar |
OpenPGP/BCPG | bcpg-lts8on-2.73.5-javadoc | bcpg-lts8on-2.73.5-javadoc.jar |
TLS | bctls-lts8on-2.73.5-javadoc | bctls-lts8on-2.73.5-javadoc.jar |
Core (lcrypto) | bccore-lts8on-2.73.5-javadoc | bccore-lts8on-2.73.5-javadoc.jar |
Learn how to use Bouncy Castle for generating certificates and certification requests, including for EJBCA. To make these tasks easier for system administrators, we will also look at Kotlin DSL as a scripting language.
Watch the training: Training - PKI at the Edge with Bouncy Castle and EJBCA
See the documentation: How-to guides and exercises - PKI at the Edge
Go to the playlist: Bouncy Castle Tutorials and Workshops
EJBCA is a fully functional Certificate Authority using J2EE technology. EJBCA builds on the J2EE platform to create a robust, high performance, platform independent, flexible, and component based CA to be used standalone or integrated in any J2EE app.
Novosec Extensions provides the following pure Java extensions to the Bouncy Castle framework and has been made freely available by www.novosec.com:
JCE taglib is a JSP tag library with cryptographic funtions and X.509 certificate generation based on BouncyCastle JCE. There is also a refactoring of JCE taglib CryptoLib on the main JCE taglib project page. CryptoLib can also be used with non-JSP projects.
LightCrypto is a library of cryptographic functions based on the lightweight API, including some functions for use with HSQLDB embeddable database.
Portecle is a user-friendly GUI application for creating, managing, and examining key stores, keys, certificates, certificate requests, certificate revocation lists, and more.
Jasypt - Java Simplified Encryption is a java library that allows the developer to add basic encryption capabilities to his/her projects with minimum effort. It offers transparent integration with Hibernate, an open API for use with any JCE provider, and is suitable for integration into Spring-based applications and ACEGI. Instructions on using it with Bouncy Castle can be found at: http://www.jasypt.org/bouncy-castle.html.
KeyTool IUI is a free user friendly GUI application for creating, managing keys and keystores as an alternative to the JDK's KeyTool command.
Cryptographie avec Bouncy Castle
Nyal
Ce tutoriel constitue une première approche pour l'utilisation de la bibliothèque Bouncy Castle.
Utiliser PGP avec Java et Bouncy Castle
Graham Jenkins (Traduction française par Simon Depiets, relecture de la traduction française par Joëlle Cornavin).
Java Cryptography: Tools and Techniques
David Hook, Jon Eaves - Leanpub
Finished in 2022 and written by two founders of the Bouncy Castle project, as a successor to "Beginning Cryptography with Java", the book covers the recent features introduced in the JCA/JCE as well the latest changes to the BC APIs and the BCFIPS Java module including the recent introduction of Post-Quantum algorithms to the BC APIs. Coverage of certificate generation, CMS, S/MIME, OpenPGP, and the TLS APIs is also included. Also available as a Paperback Edition and a Kindle Tablet Edition
A copy of the source code for the examples in the book can be downloaded here: java-crypto-tools-src.zip.
Beginning Cryptography with Java
David Hook - Wrox
Written by a Bouncy Castle APIs committer, the book covers recent features introduced in the JCA/JCE cryptography APIs in JDK 1.5 and is up to date with the cryptography APIs in J2SE 5.0, including Elliptic Curve cryptography, as well as dealing with earlier versions of the JCE/JCA in earlier JDKs. The book also deals with provider installation, X.509 certificate generation, CRL generation, and the creation and processing of PKCS #10 certification requests using the JCA and the Bouncy Castle APIs. In addition, it covers certificate validation and certificate path processing with both CRLs and OCSP. Finally, it also covers using PKCS #12, processing CMS and S/MIME messages using the BC APIs, SSL using the JSSE, and gives an introduction in how to use the Bouncy Castle ASN.1 library.
The book also has some online resources including a forum and code examples to be downloaded: beg_crypto_examples.zip. While the code examples are probably still useful, this book is now somewhat dated and we would recommend Java Cryptography: Tools and Techniques instead.
Java Cryptography Extensions : Practical Guide for Programmers
Jason Weiss - Morgan Kaufmann
Covers the JCE and some parts of the JCA as seen in JDK 1.4.
Wireless Java: Developing with Java 2, Micro Edition
Jonathan Knudsen - Apress
Includes a section on developing with the Bouncy Castle Lightweight APIs.
J2EE Security for Servlets, EJBs, and Web Services
Pankaj Kumar - Prentice Hall PTR
Includes sections on the JCE, JCA and implementing PKI systems with Java and a discussion of what goes on under the covers when you install the Bouncy Castle provider.