Bouncy Castle Java Distribution (Mirror)
Clone or download
Failed to load latest commit information.
ant Refactoring of 1.4 TLS updates. Sep 9, 2018
core Check key length for CFRG curves Sep 18, 2018
docs update for RFC3211 Sep 15, 2018
jce/src/main/java/javax/crypto added doFinal() on close Oct 5, 2015
kmip/src changed package name from bin May 6, 2017
mail corrected module-info files Sep 16, 2018
misc/src/main/java/org/bouncycastle/jcajce/examples fixed typo. May 9, 2014
pg corrected module-info files Sep 16, 2018
pkix added some extra field copies. Sep 17, 2018
prov fixed BCSFKS to use IBCFKS Sep 16, 2018
scripts update Jun 29, 2018
spotbugs Fixed immediate redeclaration of values and added spotbugs files. Aug 27, 2018
test modified JsseDefaultHostnameAuthorizer to ignore SANs it can't match.… Jun 26, 2018
tls corrected module-info files Sep 16, 2018
.gitattributes Add *.tmpl as text Mar 8, 2015
.gitignore Initial set of examples with some supporting information. Feb 7, 2017
.travis.yml update for travis May 6, 2018
CONTRIBUTORS.html Added support for writing Signed SMS files. Sep 1, 2018
LICENSE.html update Jul 1, 2018 removed Jira ref Aug 19, 2017 corrected module-info files Sep 16, 2018
build.gradle moved version to 1.59 Dec 28, 2017
build1-1 compatibility update Jun 29, 2018
build1-2 compatibility update Jun 29, 2018
build1-3 compatibility updates Jul 21, 2014
build1-4 updates Dec 3, 2013
build15+ update Jun 29, 2018
buildj2me update Jun 29, 2018
index.html fixed class cast issue in CertPathValidatorUtilities. Mar 1, 2015
settings.gradle Moved content of esttst to test Feb 5, 2017
spotbugs.gradle Fixed immediate redeclaration of values and added spotbugs files. Aug 27, 2018
spotbugs.settings.gradle update Aug 28, 2018
spotbugs_settings.gradle Fixed immediate redeclaration of values and added spotbugs files. Aug 27, 2018

The Bouncy Castle Crypto Package For Java

The Bouncy Castle Crypto package is a Java implementation of cryptographic algorithms, it was developed by the Legion of the Bouncy Castle, a registered Australian Charity, with a little help! The Legion, and the latest goings on with this package, can be found at

The Legion also gratefully acknowledges the contributions made to this package by others (see here for the current list). If you would like to contribute to our efforts please feel free to get in touch with us or visit our donations page, sponsor some specific work, or purchase a support contract through Crypto Workshop.

The package is organised so that it contains a light-weight API suitable for use in any environment (including the newly released J2ME) with the additional infrastructure to conform the algorithms to the JCE framework.

Except where otherwise stated, this software is distributed under a license based on the MIT X Consortium license. To view the license, see here. The OpenPGP library also includes a modified BZIP2 library which is licensed under the Apache Software License, Version 2.0.

Note: this source tree is not the FIPS version of the APIs - if you are interested in our FIPS version please contact us directly at

Code Organisation

The clean room JCE, for use with JDK 1.1 to JDK 1.3 is in the jce/src/main/java directory.

The core module provides all the functionality in the ligthweight APIs.

The prov module provides all the JCA/JCE provider functionality.

The pkix module is the home for code for X.509 certificate generation and the APIs for standards that rely on ASN.1 such as CMS, TSP, PKCS#12, OCSP, CRMF, and CMP.

The mail module provides an S/MIME API built on top of CMS.

The pg module is the home for code used to support OpenPGP.

The tls module is the home for code used to a general TLS API and JSSE Provider (as at 1.56 this should be considered a beta).

The build scripts that come with the full distribution allow creation of the different releases by using the different source trees while excluding classes that are not appropriate and copying in the required compatibility classes from the directories containing compatibility classes appropriate for the distribution.

If you want to try create a build for yourself, using your own environment, the best way to do it is to start with the build for the distribution you are interested in, make sure that builds, and then modify your build scripts to do the required exclusions and file copies for your setup, otherwise you are likely to get class not found exceptions. The final caveat to this is that as the j2me distribution includes some compatibility classes starting in the java package, you need to use an obfuscator to change the package names before attempting to import a midlet using the BC API.

Examples and Tests

To view some examples, look at the test programs in the packages:

  • org.bouncycastle.crypto.test

  • org.bouncycastle.jce.provider.test

  • org.bouncycastle.cms.test

  • org.bouncycastle.mail.smime.test

  • org.bouncycastle.openpgp.test

  • org.bouncycastle.tsp.test

There are also some specific example programs for dealing with SMIME and OpenPGP. They can be found in:

  • org.bouncycastle.mail.smime.examples

  • org.bouncycastle.openpgp.examples

Mailing Lists

For those who are interested, there are 2 mailing lists for participation in this project. To subscribe use the links below and include the word subscribe in the message body. (To unsubscribe, replace subscribe with unsubscribe in the message body)

**NOTE:**You need to be subscribed to send mail to the above mailing list.


If you want to provide feedback directly to the members of The Legion then please use, if you want to help this project survive please consider donating.

For bug reporting/requests you can report issues here on github, or via feedback-crypto if required. We will accept pull requests based on this repository as well.