• Home
Name Date Size #Lines LOC

..--

bcpkix/src/main/java/org/bouncycastle/03-May-2024-9,3126,154

bcprov/src/main/java/org/bouncycastle/03-May-2024-94,88865,524

patches/03-May-2024-10,1579,807

Android.mkD03-May-20245.1 KiB11485

CleanSpec.mkD03-May-20242.2 KiB500

MODULE_LICENSE_BSD_LIKED03-May-20240

NOTICED03-May-20241.1 KiB1713

README.androidD03-May-202418.3 KiB267243

bouncycastle.configD03-May-202431.7 KiB638631

bouncycastle.versionD03-May-202447 32

import_bouncycastle.shD03-May-20249.3 KiB279199

jarjar-rules.txtD03-May-202440 21

README.android

1Bouncy Castle on the Android platform.
2---
3
4The code in this directory is based on $BOUNCYCASTLE_VERSION in the
5file bouncycastle.version. See patches/README for more information on
6how the code differs from $BOUNCYCASTLE_VERSION.
7
8Porting New Versions of Bouncy Castle.
9--
10
11The following steps are recommended for porting new Bouncy Castle versions.
12
131) Retrieve the appropriate version of the Bouncy Castle source from
14   www.bouncycastle.org/latest_releases.html (both bcprov-jdk*-*.tar.gz
15   and bcpkix-jdk*-*.tar.gz files).
16
17   Check the checksum (found at http://bouncycastle.org/checksums.html) with:
18
19     md5sum bcprov-jdk*-*.tar.gz
20     sha1sum bcprov-jdk*-*.tar.gz
21     md5sum bcpkix-jdk*-*.tar.gz
22     sha1sum bcpkix-jdk*-*.tar.gz
23
242) Update the variables in bouncycastle.config and bouncycastle.version as appropriate.
25   At the very least you will need to update the bouncycastle.version.
26
273) Run:
28
29     ./import_bouncycastle.sh import bcprov-jdk*-*.tar.gz
30
31   Note the script expects to find the bcpkix-jdk*-*.tar.gz alongside the bcprov file.
32
334) If there are any errors, then modify bouncycastle.config, bouncycastle.version
34   and patches in patches/ as appropriate.  You might want to use:
35
36     ./import_bouncycastle.sh regenerate patches/*.patch
37
38   Repeat step 3.
39
405) Cleanup before building with:
41
42     m -j16 clean-bouncycastle
43
446) Build the bouncycastle target from the external/bouncycastle directory with:
45
46     mm -j16 snod && adb sync system
47
48   If there are build errors, then patches/*.mk or bouncycastle.config
49   may need updating.
50
517) Run tests to make sure things are working:
52
53     Some suggested tests by area:
54     - java.security.AlgorithmParameterGenerator
55       libcore/luni/src/test/java/libcore/java/security/OldAlgorithmParameterGeneratorTest.java
56       libcore/luni/src/test/java/libcore/javax/crypto/spec/AlgorithmParameterGeneratorTestDH.java
57       libcore/luni/src/test/java/libcore/javax/crypto/spec/AlgorithmParameterGeneratorTestDSA.java
58     - java.security.AlgorithmParameters
59       libcore/luni/src/test/java/libcore/javax/crypto/spec/AlgorithmParametersTestDSA.java
60       libcore/luni/src/test/java/libcore/javax/crypto/spec/AlgorithmParametersTestAES.java
61       libcore/luni/src/test/java/libcore/javax/crypto/spec/AlgorithmParametersTestDH.java
62       libcore/luni/src/test/java/libcore/javax/crypto/spec/AlgorithmParametersTestDESede.java
63       libcore/luni/src/test/java/libcore/javax/crypto/spec/AlgorithmParametersTestDES.java
64       libcore/luni/src/test/java/libcore/javax/crypto/spec/AlgorithmParametersTestOAEP.java
65       libcore/luni/src/test/java/org/apache/harmony/security/tests/java/security/AlgorithmParameterGenerator1Test.java
66       libcore/luni/src/test/java/org/apache/harmony/security/tests/java/security/AlgorithmParameterGenerator2Test.java
67       libcore/luni/src/test/java/org/apache/harmony/security/tests/java/security/AlgorithmParametersSpiTest.java
68       libcore/luni/src/test/java/org/apache/harmony/security/tests/java/security/AlgorithmParametersTest.java
69       libcore/luni/src/test/java/org/apache/harmony/security/tests/java/security/AlgorithmParametersTest.java
70     - java.security.cert.CertPathBuilder
71       libcore/luni/src/test/java/tests/targets/security/cert/CertPathBuilderTestPKIX.java
72     - java.security.cert.CertPathValidator
73       libcore/luni/src/test/java/tests/targets/security/cert/CertPathValidatorTestPKIX.java
74     - java.security.cert.CertStore
75       libcore/luni/src/test/java/tests/security/cert/CertStoreSpiTest.java
76       libcore/luni/src/test/java/tests/security/cert/CertStore2Test.java
77       libcore/luni/src/test/java/tests/security/cert/CertStore1Test.java
78       libcore/luni/src/test/java/tests/security/cert/CertStoreExceptionTest.java
79     - java.security.cert.Certificate
80       libcore/luni/src/test/java/libcore/java/security/cert/X509CertificateTest.java
81       libcore/luni/src/test/java/tests/api/javax/security/cert/X509CertificateTest.java
82       libcore/luni/src/test/java/tests/security/cert/CertificateCertificateRepTest.java
83       libcore/luni/src/test/java/tests/security/cert/CertificateTest.java
84       libcore/luni/src/test/java/tests/security/cert/X509Certificate2Test.java
85       libcore/luni/src/test/java/tests/targets/security/cert/CertificateTest.java
86     - java.security.cert.CertificateFactory
87       libcore/luni/src/test/java/libcore/java/security/cert/CertificateFactoryTest.java
88       libcore/luni/src/test/java/tests/security/cert/CertificateFactory1Test.java
89       libcore/luni/src/test/java/tests/security/cert/CertificateFactory2Test.java
90       libcore/luni/src/test/java/tests/security/cert/CertificateFactory3Test.java
91       libcore/luni/src/test/java/tests/security/cert/CertificateFactory4Test.java
92       libcore/luni/src/test/java/tests/targets/security/cert/CertificateFactoryTestX509.java
93     - java.security.cert.CertificateFactorySpi
94       libcore/luni/src/test/java/tests/security/cert/CertificateFactorySpiTest.java
95     - java.security.cert.CRL
96       libcore/luni/src/test/java/libcore/java/security/cert/X509CRLSelectorTest.java
97       libcore/luni/src/test/java/libcore/java/security/cert/X509CRLTest.java
98       libcore/luni/src/test/java/tests/security/cert/CRLTest.java
99       libcore/luni/src/test/java/tests/security/cert/X509CRL2Test.java
100       libcore/luni/src/test/java/tests/security/cert/X509CRLEntryTest.java
101       libcore/luni/src/test/java/tests/security/cert/X509CRLSelector2Test.java
102       libcore/luni/src/test/java/tests/security/cert/X509CRLSelectorTest.java
103       libcore/luni/src/test/java/tests/security/cert/X509CRLTest.java
104     - javax.security.cert.Certificate
105       libcore/luni/src/test/java/tests/api/javax/security/cert/CertificateTest.java
106     - java.security.CodeSigner
107       libcore/luni/src/test/java/org/apache/harmony/security/tests/java/security/CodeSignerTest.java
108     - javax.crypto.Cipher
109       libcore/luni/src/test/java/libcore/javax/crypto/CipherTest.java
110       libcore/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/CipherTest.java
111       libcore/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/NullCipherTest.java
112     - java.security.DigestInputStream
113       libcore/luni/src/test/java/org/apache/harmony/security/tests/java/security/DigestInputStream2Test.java
114       libcore/luni/src/test/java/org/apache/harmony/security/tests/java/security/DigestInputStreamTest.java
115     - java.security.DigestOutputStream
116       libcore/luni/src/test/java/org/apache/harmony/security/tests/java/security/DigestOutputStreamTest.java
117     - java.security.GuardedObject
118       libcore/luni/src/test/java/org/apache/harmony/security/tests/java/security/GuardedObjectTest.java
119     - java.security.Identity
120       libcore/luni/src/test/java/org/apache/harmony/security/tests/java/security/Identity2Test.java
121     - java.security.IdentityScope
122       libcore/luni/src/test/java/org/apache/harmony/security/tests/java/security/IdentityScope2Test.java
123       libcore/luni/src/test/java/org/apache/harmony/security/tests/java/security/IdentityScopeTest.java
124     - javax.crypto.Key
125       libcore/luni/src/test/java/org/apache/harmony/security/tests/java/security/KeyTest.java
126     - javax.crypto.KeyAgreement
127       libcore/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/KeyAgreementTest.java
128     - java.security.KeyFactory
129       libcore/luni/src/test/java/libcore/javax/crypto/spec/KeyFactoryTestDH.java
130       libcore/luni/src/test/java/libcore/javax/crypto/spec/KeyFactoryTestDSA.java
131       libcore/luni/src/test/java/libcore/javax/crypto/spec/KeyFactoryTestRSA.java
132       libcore/luni/src/test/java/org/apache/harmony/security/tests/java/security/KeyFactory2Test.java
133       libcore/luni/src/test/java/org/apache/harmony/security/tests/java/security/KeyFactoryTest.java
134     - java.security.KeyFactorySpi
135       libcore/luni/src/test/java/org/apache/harmony/security/tests/java/security/KeyFactorySpiTest.java
136     - javax.crypto.KeyGenerator
137       libcore/luni/src/test/java/libcore/javax/crypto/KeyGeneratorTest.java
138       libcore/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/KeyGeneratorTest.java
139     - javax.net.ssl.KeyManagerFactory
140       libcore/luni/src/test/java/libcore/javax/net/ssl/KeyManagerFactoryTest.java
141     - java.security.KeyPair
142       libcore/luni/src/test/java/org/apache/harmony/security/tests/java/security/KeyPairTest.java
143     - java.security.KeyPairGenerator
144       libcore/luni/src/test/java/libcore/java/security/KeyPairGeneratorTest.java
145       libcore/luni/src/test/java/libcore/java/security/OldKeyPairGeneratorTestDH.java
146       libcore/luni/src/test/java/libcore/javax/crypto/spec/KeyPairGeneratorTestDH.java
147       libcore/luni/src/test/java/libcore/javax/crypto/spec/KeyPairGeneratorTestDSA.java
148       libcore/luni/src/test/java/libcore/javax/crypto/spec/KeyPairGeneratorTestRSA.java
149       libcore/luni/src/test/java/org/apache/harmony/security/tests/java/security/KeyPairGenerator1Test.java
150       libcore/luni/src/test/java/org/apache/harmony/security/tests/java/security/KeyPairGenerator2Test.java
151       libcore/luni/src/test/java/org/apache/harmony/security/tests/java/security/KeyPairGenerator3Test.java
152       libcore/luni/src/test/java/org/apache/harmony/security/tests/java/security/KeyPairGenerator4Test.java
153       libcore/luni/src/test/java/org/apache/harmony/security/tests/java/security/KeyPairGeneratorSpiTest.java
154       libcore/luni/src/test/java/tests/security/interfaces/DSAKeyPairGeneratorTest.java
155     - java.security.KeyRep
156       libcore/luni/src/test/java/org/apache/harmony/security/tests/java/security/KeyRepTest.java
157       libcore/luni/src/test/java/org/apache/harmony/security/tests/java/security/KeyRepTypeTest.java
158     - java.security.KeyStore
159       libcore/luni/src/test/java/libcore/java/security/KeyStoreTest.java
160       libcore/luni/src/test/java/org/apache/harmony/security/tests/java/security/KSCallbackHandlerProtectionTest.java
161       libcore/luni/src/test/java/org/apache/harmony/security/tests/java/security/KSPasswordProtectionTest.java
162       libcore/luni/src/test/java/org/apache/harmony/security/tests/java/security/KSPrivateKeyEntryTest.java
163       libcore/luni/src/test/java/org/apache/harmony/security/tests/java/security/KSSecretKeyEntryTest.java
164       libcore/luni/src/test/java/org/apache/harmony/security/tests/java/security/KSTrustedCertificateEntryTest.java
165       libcore/luni/src/test/java/org/apache/harmony/security/tests/java/security/KeyStore2Test.java
166       libcore/luni/src/test/java/org/apache/harmony/security/tests/java/security/KeyStore3Test.java
167       libcore/luni/src/test/java/org/apache/harmony/security/tests/java/security/KeyStore4Test.java
168       libcore/luni/src/test/java/org/apache/harmony/security/tests/java/security/KeyStoreBuilderTest.java
169       libcore/luni/src/test/java/org/apache/harmony/security/tests/java/security/KeyStorePrivateKeyEntryTest.java
170       libcore/luni/src/test/java/org/apache/harmony/security/tests/java/security/KeyStoreTest.java
171       libcore/luni/src/test/java/org/apache/harmony/security/tests/java/security/KeyStoreTest.java
172     - java.security.KeyStoreSpi
173       libcore/luni/src/test/java/org/apache/harmony/security/tests/java/security/KeyStoreSpiTest.java
174     - javax.crypto.Mac
175       libcore/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/MacTest.java
176     - java.security.MessageDigest
177       libcore/luni/src/test/java/libcore/java/security/MessageDigestTest.java
178       libcore/luni/src/test/java/org/apache/harmony/security/tests/java/security/MessageDigest1Test.java
179       libcore/luni/src/test/java/org/apache/harmony/security/tests/java/security/MessageDigest2Test.java
180       libcore/luni/src/test/java/tests/targets/security/MessageDigestTestMD2.java
181       libcore/luni/src/test/java/tests/targets/security/MessageDigestTestMD5.java
182       libcore/luni/src/test/java/tests/targets/security/MessageDigestTestSHA1.java
183       libcore/luni/src/test/java/tests/targets/security/MessageDigestTestSHA256.java
184       libcore/luni/src/test/java/tests/targets/security/MessageDigestTestSHA384.java
185       libcore/luni/src/test/java/tests/targets/security/MessageDigestTestSHA512.java
186     - java.security.MessageDigestSpi
187       libcore/luni/src/test/java/org/apache/harmony/security/tests/java/security/MessageDigestSpiTest.java
188     - java.security.PrivateKey
189       libcore/luni/src/test/java/org/apache/harmony/security/tests/java/security/PrivateKeyTest.java
190     - java.security.PrivilegedAction
191       libcore/luni/src/test/java/org/apache/harmony/security/tests/java/security/PrivilegedActionTest.java
192     - java.security.Provider
193       libcore/luni/src/test/java/libcore/java/security/ProviderTest.java
194       libcore/luni/src/test/java/org/apache/harmony/security/tests/java/security/Provider2Test.java
195       libcore/luni/src/test/java/org/apache/harmony/security/tests/java/security/ProviderServiceTest.java
196       libcore/luni/src/test/java/org/apache/harmony/security/tests/java/security/ProviderTest.java
197     - java.security.PublicKey
198       libcore/luni/src/test/java/org/apache/harmony/security/tests/java/security/PublicKeyTest.java
199     - java.security.Security
200       libcore/luni/src/test/java/org/apache/harmony/security/tests/java/security/Security2Test.java
201       libcore/luni/src/test/java/org/apache/harmony/security/tests/java/security/SecurityTest.java
202     - javax.net.ssl.SSLContext
203       libcore/luni/src/test/java/libcore/javax/net/ssl/SSLContextTest.java
204     - javax.crypto.SecretKeyFactory
205       libcore/luni/src/test/java/libcore/javax/crypto/SecretKeyFactoryTest.java
206       libcore/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/SecretKeyFactoryTest.java
207     - java.security.SecureRandom
208       libcore/luni/src/test/java/libcore/java/security/SecureRandomTest.java
209       libcore/luni/src/test/java/org/apache/harmony/security/tests/java/security/SecureRandom2Test.java
210       libcore/luni/src/test/java/tests/java/security/SecureRandomTest.java
211       libcore/luni/src/test/java/tests/targets/security/SecureRandomTestSHA1PRNG.java
212     - java.security.SecureRandomSpi
213       libcore/luni/src/test/java/org/apache/harmony/security/tests/java/security/SecureRandomSpiTest.java
214     - java.security.Signature
215       libcore/luni/src/test/java/libcore/java/security/SignatureTest.java
216       libcore/luni/src/test/java/org/apache/harmony/security/tests/java/security/Signature2Test.java
217       libcore/luni/src/test/java/org/apache/harmony/security/tests/java/security/SignatureTest.java
218       libcore/luni/src/test/java/org/apache/harmony/xnet/provider/jsse/OpenSSLSignatureTest.java
219       libcore/luni/src/test/java/tests/targets/security/SignatureTestMD2withRSA.java
220     - java.security.SignatureSpi
221       libcore/luni/src/test/java/org/apache/harmony/security/tests/java/security/SignatureSpiTest.java
222     - java.security.SignedObject
223       libcore/luni/src/test/java/org/apache/harmony/security/tests/java/security/SignedObjectTest.java
224     - java.security.Signer
225       libcore/luni/src/test/java/org/apache/harmony/security/tests/java/security/SignerTest.java
226     - java.security.Timestamp
227       libcore/luni/src/test/java/org/apache/harmony/security/tests/java/security/TimestampTest.java
228     - javax.net.ssl.TrustManagerFactory
229       libcore/luni/src/test/java/libcore/javax/net/ssl/TrustManagerFactoryTest.java
230     - javax.net.ssl.SSLSocket and javax.net.ssl.SSLEngine (which touch on Cipher, MessageDigest, Signature)
231       libcore/luni/src/test/java/libcore/javax/net/ssl/
232     - Test Android additions to bouncycastle such as org.bouncycastle.crypto.digests.OpenSSLDigest and org.bouncycastle.jce.provider.CertBlacklist
233       libcore/luni/src/test/java/com/android/org/bouncycastle/
234     - Exception "tests"
235       libcore/luni/src/test/java/org/apache/harmony/security/tests/java/security/DigestExceptionTest.java
236       libcore/luni/src/test/java/org/apache/harmony/security/tests/java/security/GeneralSecurityExceptionTest.java
237       libcore/luni/src/test/java/org/apache/harmony/security/tests/java/security/InvalidAlgorithmParameterExceptionTest.java
238       libcore/luni/src/test/java/org/apache/harmony/security/tests/java/security/InvalidKeyExceptionTest.java
239       libcore/luni/src/test/java/org/apache/harmony/security/tests/java/security/InvalidParameterExceptionTest.java
240       libcore/luni/src/test/java/org/apache/harmony/security/tests/java/security/KeyExceptionTest.java
241       libcore/luni/src/test/java/org/apache/harmony/security/tests/java/security/KeyManagementExceptionTest.java
242       libcore/luni/src/test/java/org/apache/harmony/security/tests/java/security/KeyStoreExceptionTest.java
243       libcore/luni/src/test/java/org/apache/harmony/security/tests/java/security/NoSuchAlgorithmExceptionTest.java
244       libcore/luni/src/test/java/org/apache/harmony/security/tests/java/security/NoSuchProviderExceptionTest.java
245       libcore/luni/src/test/java/org/apache/harmony/security/tests/java/security/ProviderExceptionTest.java
246       libcore/luni/src/test/java/org/apache/harmony/security/tests/java/security/SignatureExceptionTest.java
247       libcore/luni/src/test/java/org/apache/harmony/security/tests/java/security/UnrecoverableEntryExceptionTest.java
248       libcore/luni/src/test/java/org/apache/harmony/security/tests/java/security/UnrecoverableKeyExceptionTest.java
249       libcore/luni/src/test/java/tests/api/javax/security/cert/CertificateEncodingExceptionTest.java
250       libcore/luni/src/test/java/tests/api/javax/security/cert/CertificateExceptionTest.java
251       libcore/luni/src/test/java/tests/api/javax/security/cert/CertificateExpiredExceptionTest.java
252       libcore/luni/src/test/java/tests/api/javax/security/cert/CertificateNotYetValidExceptionTest.java
253       libcore/luni/src/test/java/tests/api/javax/security/cert/CertificateParsingExceptionTest.java
254       libcore/luni/src/test/java/tests/security/cert/CRLExceptionTest.java
255       libcore/luni/src/test/java/tests/security/cert/CertificateEncodingException2Test.java
256       libcore/luni/src/test/java/tests/security/cert/CertificateEncodingExceptionTest.java
257       libcore/luni/src/test/java/tests/security/cert/CertificateException2Test.java
258       libcore/luni/src/test/java/tests/security/cert/CertificateExceptionTest.java
259       libcore/luni/src/test/java/tests/security/cert/CertificateExpiredExceptionTest.java
260       libcore/luni/src/test/java/tests/security/cert/CertificateNotYetValidExceptionTest.java
261       libcore/luni/src/test/java/tests/security/cert/CertificateParsingExceptionTest.java
262
263
2648) Do a full build before checking in:
265
266     m -j16
267