diff --git a/README.md b/README.md index 59f9a02..008c964 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,19 @@ # java-bouncycastle +The Bouncy Castle Crypto APIs for Java consist of the following: + +* A lightweight cryptography API. +* A provider for the Java Cryptography Extension and the Java Cryptography Architecture. +* A clean room implementation of the JCE 1.2.1. +* A library for reading and writing encoded ASN.1 objects. +* A lightweight client-side TLS API. +* Generators for Version 1 and Version 3 X.509 certificates, Version 2 CRLs, and PKCS12 files. +* Generators for Version 2 X.509 attribute certificates. +* Generators/Processors for S/MIME and CMS (PKCS7/RFC 3852). +* Generators/Processors for OCSP (RFC 2560). +* Generators/Processors for TSP (RFC 3161). +* Generators/Processors for OpenPGP (RFC 2440). +* A signed jar version suitable for JDK 1.4-1.6 and the Sun JCE. + +The lightweight API works with everything from the J2ME to the JDK 1.6. + diff --git a/bcmail-jdk16-1.45.pom b/bcmail-jdk16-1.45.pom new file mode 100644 index 0000000..0aaf180 --- /dev/null +++ b/bcmail-jdk16-1.45.pom @@ -0,0 +1,29 @@ + + + 4.0.0 + org.bouncycastle + bcmail-jdk16 + jar + Bouncy Castle CMS and S/MIME API + 1.45 + The Bouncy Castle Java CMS and S/MIME APIs for handling the CMS and S/MIME protocols. This jar contains CMS and S/MIME APIs for JDK 1.6. The APIs can be used in conjunction with a JCE/JCA provider such as the one provided with the Bouncy Castle Cryptography APIs. If the S/MIME API is used, the JavaMail API and the Java activation framework will also be needed. + http://www.bouncycastle.org/java.html + + + Bouncy Castle Licence + http://www.bouncycastle.org/licence.html + repo + + + + http://www.bouncycastle.org/viewcvs/viewcvs.cgi/java + + + + org.bouncycastle + bcprov-jdk16 + 1.45 + jar + + + diff --git a/bcpg-jdk16-1.45.pom b/bcpg-jdk16-1.45.pom new file mode 100644 index 0000000..0ad3c1a --- /dev/null +++ b/bcpg-jdk16-1.45.pom @@ -0,0 +1,34 @@ + + + 4.0.0 + org.bouncycastle + bcpg-jdk16 + jar + Bouncy Castle OpenPGP API + 1.45 + The Bouncy Castle Java API for handling the OpenPGP protocol. This jar contains the OpenPGP API for JDK 1.6. The APIs can be used in conjunction with a JCE/JCA provider such as the one provided with the Bouncy Castle Cryptography APIs. + http://www.bouncycastle.org/java.html + + + Bouncy Castle Licence + http://www.bouncycastle.org/licence.html + repo + + + Apache Software License, Version 1.1 + http://www.apache.org/licenses/LICENSE-1.1 + repo + + + + http://www.bouncycastle.org/viewcvs/viewcvs.cgi/java + + + + org.bouncycastle + bcprov-jdk16 + 1.45 + jar + + + diff --git a/bcprov-ext-jdk16-1.45.pom b/bcprov-ext-jdk16-1.45.pom new file mode 100644 index 0000000..61d1daa --- /dev/null +++ b/bcprov-ext-jdk16-1.45.pom @@ -0,0 +1,21 @@ + + + 4.0.0 + org.bouncycastle + bcprov-ext-jdk16 + jar + Bouncy Castle Provider + 1.45 + The Bouncy Castle Crypto package is a Java implementation of cryptographic algorithms. This jar contains JCE provider and lightweight API for the Bouncy Castle Cryptography APIs for JDK 1.6. Note: this package includes the IDEA encryption algorithm. + http://www.bouncycastle.org/java.html + + + Bouncy Castle Licence + http://www.bouncycastle.org/licence.html + repo + + + + http://www.bouncycastle.org/viewcvs/viewcvs.cgi/java + + diff --git a/bcprov-jdk16-1.45.pom b/bcprov-jdk16-1.45.pom new file mode 100644 index 0000000..c5eff7a --- /dev/null +++ b/bcprov-jdk16-1.45.pom @@ -0,0 +1,21 @@ + + + 4.0.0 + org.bouncycastle + bcprov-jdk16 + jar + Bouncy Castle Provider + 1.45 + The Bouncy Castle Crypto package is a Java implementation of cryptographic algorithms. This jar contains JCE provider and lightweight API for the Bouncy Castle Cryptography APIs for JDK 1.6. + http://www.bouncycastle.org/java.html + + + Bouncy Castle Licence + http://www.bouncycastle.org/licence.html + repo + + + + http://www.bouncycastle.org/viewcvs/viewcvs.cgi/java + + diff --git a/bctsp-jdk16-1.45.pom b/bctsp-jdk16-1.45.pom new file mode 100644 index 0000000..e87422b --- /dev/null +++ b/bctsp-jdk16-1.45.pom @@ -0,0 +1,35 @@ + + + 4.0.0 + org.bouncycastle + bctsp-jdk16 + jar + Bouncy Castle OpenPGP API + 1.45 + The Bouncy Castle Java API for handling the Time Stamp Protocol (TSP). This jar contains the TSP API for JDK 1.6. The APIs can be used in conjunction with a JCE/JCA provider such as the one provided with the Bouncy Castle Cryptography APIs. + http://www.bouncycastle.org/java.html + + + Bouncy Castle Licence + http://www.bouncycastle.org/licence.html + repo + + + + http://www.bouncycastle.org/viewcvs/viewcvs.cgi/java + + + + org.bouncycastle + bcprov-jdk16 + 1.45 + jar + + + org.bouncycastle + bcmail-jdk16 + 1.45 + jar + + + diff --git a/java-bouncycastle-1.45-build1-4.patch b/java-bouncycastle-1.45-build1-4.patch new file mode 100644 index 0000000..c52180d --- /dev/null +++ b/java-bouncycastle-1.45-build1-4.patch @@ -0,0 +1,24 @@ +--- crypto-145/build1-4 2008-12-05 02:53:01.000000000 +0100 ++++ crypto-145/build1-4-gil 2010-02-25 19:19:34.000000000 +0100 +@@ -6,9 +6,9 @@ + # otherwise it just creates the docs and class files. + # + +-JDKPATH=/opt/jdk1.4.2 +-JAVA_MAIL_HOME=/opt/javamail-1.3.1 +-JAVA_ACTIVATION_HOME=/opt/jaf-1.0.2 ++JDKPATH=/usr/lib/jvm/jdk-sun-1.4 ++JAVA_MAIL_HOME=/usr/share/java/geronimo ++JAVA_ACTIVATION_HOME=/usr/share/java/geronimo + + JAVA_HOME=$JDKPATH + export JAVA_HOME +@@ -16,7 +16,7 @@ + PATH=$JDKPATH/bin:$PATH + export PATH + +-CLASSPATH=$JAVA_MAIL_HOME/mail.jar:$JAVA_ACTIVATION_HOME/activation.jar:$CLASSPATH ++CLASSPATH=$JAVA_MAIL_HOME/javamail-1.4-api.jar:$JAVA_ACTIVATION_HOME/activation-1.0.2-api.jar:$CLASSPATH + export CLASSPATH + + if [ "$1" = "test" ] diff --git a/java-bouncycastle-1.45-build1-5.patch b/java-bouncycastle-1.45-build1-5.patch new file mode 100644 index 0000000..d668c85 --- /dev/null +++ b/java-bouncycastle-1.45-build1-5.patch @@ -0,0 +1,26 @@ +--- crypto-145/build1-5 2009-01-06 11:59:16.000000000 +0100 ++++ crypto-145/build1-5-gil 2010-02-25 19:17:33.000000000 +0100 +@@ -6,10 +6,10 @@ + # otherwise it just creates the docs and class files. + # + +-JDKPATH=/opt/jdk1.5.0 # JDK 1.5 location +-JAVA_MAIL_HOME=/opt/javamail +-JAVA_ACTIVATION_HOME=/opt/jaf +-JUNIT_HOME=/opt/junit ++JDKPATH=/usr/lib/jvm/jdk-sun-1.5 # JDK 1.5 location ++JAVA_MAIL_HOME=/usr/share/java/geronimo ++JAVA_ACTIVATION_HOME=/usr/share/java/geronimo ++JUNIT_HOME=/usr/share/java + + JAVA_HOME=$JDKPATH + export JAVA_HOME +@@ -17,7 +17,7 @@ + PATH=$JDKPATH/bin:$PATH + export PATH + +-CLASSPATH=$JAVA_MAIL_HOME/mail.jar:$JAVA_ACTIVATION_HOME/activation.jar:$JUNIT_HOME/junit.jar:$CLASSPATH ++CLASSPATH=$JAVA_MAIL_HOME/javamail-1.4-api.jar:$JAVA_ACTIVATION_HOME/activation-1.0.2-api.jar:$JUNIT_HOME/junit381-jdk5.jar:$CLASSPATH + export CLASSPATH + + if [ "$1" = "test" ] diff --git a/java-bouncycastle-1.45-build1-6.patch b/java-bouncycastle-1.45-build1-6.patch new file mode 100644 index 0000000..a567e2b --- /dev/null +++ b/java-bouncycastle-1.45-build1-6.patch @@ -0,0 +1,26 @@ +--- crypto-145/build1-6 2008-11-22 04:30:03.000000000 +0100 ++++ crypto-145/build1-6-gil 2010-02-25 19:11:35.000000000 +0100 +@@ -6,10 +6,10 @@ + # otherwise it just creates the docs and class files. + # + +-JDKPATH=/opt/jdk1.6.0 # JDK 1.6 location +-JAVA_MAIL_HOME=/opt/javamail-1.3.1 +-JAVA_ACTIVATION_HOME=/opt/jaf-1.0.2 +-JUNIT_HOME=/opt/junit3.8.1 ++JDKPATH=/opt/java/jdk # JDK 1.6 location ++JAVA_MAIL_HOME=/usr/share/java/geronimo ++JAVA_ACTIVATION_HOME=/usr/share/java/geronimo ++JUNIT_HOME=/usr/share/java + + JAVA_HOME=$JDKPATH + export JAVA_HOME +@@ -17,7 +17,7 @@ + PATH=$JDKPATH/bin:$PATH + export PATH + +-CLASSPATH=$JAVA_MAIL_HOME/mail.jar:$JAVA_ACTIVATION_HOME/activation.jar:$JUNIT_HOME/junit.jar:$CLASSPATH ++CLASSPATH=$JAVA_MAIL_HOME/javamail-1.4-api.jar:$JAVA_ACTIVATION_HOME/activation-1.0.2-api.jar:$JUNIT_HOME/junit381.jar:$CLASSPATH + export CLASSPATH + + if [ "$1" = "test" ] diff --git a/java-bouncycastle.spec b/java-bouncycastle.spec new file mode 100644 index 0000000..587a94b --- /dev/null +++ b/java-bouncycastle.spec @@ -0,0 +1,284 @@ +%define pkg_version 145 +Name: java-bouncycastle +Version: 1.45 +Release: 3mamba +Summary: Bouncy Castle Crypto Package for Java 1.6 +Group: System/Libraries/Java +Vendor: openmamba +Distribution: openmamba +Packager: Silvan Calarco +URL: http://www.bouncycastle.org/java.html +Source0: http://downloads.bouncycastle.org/java/crypto-%{pkg_version}.tar.gz +Source1: http://repo2.maven.org/maven2/org/bouncycastle/bcprov-jdk16/%{version}/bcprov-jdk16-%{version}.pom +Source2: http://repo2.maven.org/maven2/org/bouncycastle/bcmail-jdk16/%{version}/bcmail-jdk16-%{version}.pom +Source3: http://repo2.maven.org/maven2/org/bouncycastle/bcpg-jdk16/%{version}/bcpg-jdk16-%{version}.pom +Source4: http://repo2.maven.org/maven2/org/bouncycastle/bctsp-jdk16/%{version}/bctsp-jdk16-%{version}.pom +Source5: http://repo2.maven.org/maven2/org/bouncycastle/bcprov-ext-jdk16/%{version}/bcprov-ext-jdk16-%{version}.pom +Patch0: java-bouncycastle-1.45-build1-6.patch +Patch1: java-bouncycastle-1.45-build1-5.patch +Patch2: java-bouncycastle-1.45-build1-4.patch +License: Apache Software License Version 1.1, MIT, X11 +BuildRequires: apache-ant +BuildRequires: apache-ant-junit +%if "%{stage1}" != "1" +BuildRequires: apache-geronimo-1.2-specs +BuildRequires: java-jcoverage +BuildRequires: java-pack200-ant-task +%else +BuildRequires: java-glassfish-javamail +%endif +BuildRequires: java-junit3 +BuildRequires: jpackage-utils +%if "%{stage1}" != "1" +Requires: apache-geronimo-1.2-specs +%else +Requires: java-glassfish-javamail +%endif +Provides: jce = 1.6.0.0 +Obsoletes: java-bouncycastle143 +Provides: java-bouncycastle143 +Obsoletes: java-bouncycastle145 +Provides: java-bouncycastle145 +Obsoletes: java-bouncycastle-bcpg +Provides: java-bouncycastle-bcpg +Obsoletes: java-bouncycastle-bctsp +Provides: java-bouncycastle-bctsp +Obsoletes: java-bouncycastle-crypto +Provides: java-bouncycastle-crypto +Obsoletes: java-bouncycastle-mail +Provides: java-bouncycastle-mail +BuildRoot: %{_tmppath}/%{name}-%{version}-root + +%description +The Bouncy Castle Crypto APIs for Java consist of the following: + +* A lightweight cryptography API. +* A provider for the Java Cryptography Extension and the Java Cryptography Architecture. +* A clean room implementation of the JCE 1.2.1. +* A library for reading and writing encoded ASN.1 objects. +* A lightweight client-side TLS API. +* Generators for Version 1 and Version 3 X.509 certificates, Version 2 CRLs, and PKCS12 files. +* Generators for Version 2 X.509 attribute certificates. +* Generators/Processors for S/MIME and CMS (PKCS7/RFC 3852). +* Generators/Processors for OCSP (RFC 2560). +* Generators/Processors for TSP (RFC 3161). +* Generators/Processors for OpenPGP (RFC 2440). +* A signed jar version suitable for JDK 1.4-1.6 and the Sun JCE. + +The lightweight API works with everything from the J2ME to the JDK 1.6. + +%package javadoc +Group: Documentation +Summary: Java 1.6 javadoc for %{name} + +%description javadoc +Bouncy Castle Crypto Package for Java 1.6. + +This package contains javadoc for %{name}. + +%prep +%setup -q -c -n bouncycastle-%{version} + +%if "%{stage1}" != "1" +for j in $(find . -name "*.jar"); do + mv $j ${j}.no +done + +#mv crypto-%{pkg_version}/lib/Pack200Task.jar.no crypto-%{pkg_version}/lib/Pack200Task.jar +ln -sf $(build-classpath pack200task) crypto-%{pkg_version}/lib/Pack200Task.jar +%endif + +%patch0 +%patch1 +%patch2 + +%build +pushd crypto-%{pkg_version} + + export JAVA_HOME=%{_jvmdir}/jdk + %if "%{stage1}" != "1" + export CLASSPATH=$(build-classpath jcoverage junit-3.8.2 geronimo/activation-1.0.2-api geronimo/javamail-1.4-api ant/ant-junit) + %else + export CLASSPATH=$(build-classpath ant/ant-junit junit-3.8.2 glassfish-javamail/javamail) + %endif + ant -buildfile jdk16.xml \ + -Dbc.javac.source=1.5 \ + -Dbc.javac.target=1.5 \ + -Dencoding=cp1252 \ + -Djunit.jar=$(build-classpath junit-3.8.2) \ +%if "%{stage1}" != "1" + -Dactivation.jar=$(build-classpath geronimo/activation-1.0.2-api) \ + -Dmail.jar=$(build-classpath geronimo/javamail-1.4-api) \ + -Dmailapi.jar=$(build-classpath geronimo/javamail-1.4-api) \ +%else + -Dmail.jar=$(build-classpath glassfish-javamail/javamail) \ + -Dmailapi.jar=$(build-classpath glassfish-javamail/javamail) \ +%endif + -Drelease.suffix=%{version} \ + build-provider build build-test +# test-lw + + export CLASSPATH=$CLASSPATH + ant -buildfile bc-build.xml \ + -Dbc.javac.source=1.5 \ + -Dbc.javac.target=1.5 \ + -Dsrc.dir=src \ + -Dtarget.prefix=jdk1.6 \ + -Dartifacts.dir=$PWD/build/artifacts/jdk1.6 \ + -Dencoding=cp1252 \ + -Djunit.jar=$(build-classpath junit381) \ +%if "%{stage1}" != "1" + -Dactivation.jar=$(build-classpath geronimo/activation-1.0.2-api) \ + -Dmail.jar=$(build-classpath geronimo/javamail-1.4-api) \ + -Dmailapi.jar=$(build-classpath geronimo/javamail-1.4-api) \ +%else + -Dmail.jar=$(build-classpath glassfish-javamail/mailapi) \ + -Dmailapi.jar=$(build-classpath glassfish-javamail/mailapi) \ +%endif + -Drelease.suffix=%{version} \ + build-jce +# javadoc-jce +popd + +%install +[ "%{buildroot}" != / ] && rm -rf "%{buildroot}" + +mkdir -p %{buildroot}%{_javadir}/gcj-endorsed +mkdir -p %{buildroot}%{_javadir}-{ext,1.6.0} + +pushd crypto-%{pkg_version}/build/artifacts/jdk1.6/jars + for jar in {bcmail,bcpg,bcprov,bcprov-ext,bctest,bctsp}-jdk16-%{version}.jar; do + jard=$(echo $jar | sed s/-jdk16//g) + install -pm 644 $jar %{buildroot}%{_javadir}/$jard + done + install -pm 644 jce-jdk1.6-%{version}.jar %{buildroot}%{_javadir}/bcjce-%{version}.jar + install -pm 644 jce-ext-jdk1.6-%{version}.jar %{buildroot}%{_javadir}/bcjce-ext-%{version}.jar +popd + +install -dm 755 %{buildroot}%{_sysconfdir}/java/security/security.d +touch %{buildroot}%{_sysconfdir}/java/security/security.d/2000-org.bouncycastle.jce.provider.BouncyCastleProvider + +pushd %{buildroot}%{_javadir}-ext/ + ln -sf ../java/bcprov-ext-%{version}.jar bcprov-ext-%{version}.jar +popd + +pushd %{buildroot}%{_javadir}/gcj-endorsed + ln -sf ../bcprov-%{version}.jar bcprov-%{version}.jar +popd + +( + cd %{buildroot}%{_javadir} + for jar in *-%{version}.jar; do + ln -sf ${jar} $(echo $jar| sed -e "s|-%{version}||g") + done + for jar in *.jar; do + ln -sf ../java/${jar} %{buildroot}%{_javadir}-1.6.0/${jar} + done +) + +mkdir -p %{buildroot}%{_mavenpomdir} +install -pm 644 %{SOURCE1} %{buildroot}%{_mavenpomdir}/JPP-bcprov.pom +%add_to_maven_depmap org.bouncycastle bcprov-jdk16 %{version} JPP bcprov +install -pm 644 %{SOURCE2} %{buildroot}%{_mavenpomdir}/JPP-bcprov.pom +%add_to_maven_depmap org.bouncycastle bcmail-jdk16 %{version} JPP bcmail +install -pm 644 %{SOURCE3} %{buildroot}%{_mavenpomdir}/JPP-bcpg.pom +%add_to_maven_depmap org.bouncycastle bcpg-jdk16 %{version} JPP bcpg +install -pm 644 %{SOURCE4} %{buildroot}%{_mavenpomdir}/JPP-bctsp.pom +%add_to_maven_depmap org.bouncycastle bctsp-jdk16 %{version} JPP bctsp +install -pm 644 %{SOURCE5} %{buildroot}%{_mavenpomdir}/JPP-bcprov-ext.pom +%add_to_maven_depmap org.bouncycastle bcprov-ext-jdk16 %{version} JPP bcprov-ext + +pushd crypto-%{pkg_version}/build/artifacts/jdk1.6 + mkdir -p %{buildroot}%{_javadocdir}/bouncycastle-%{version} + cp -pr javadoc/* %{buildroot}%{_javadocdir}/bouncycastle-%{version} + ln -sf bouncycastle-%{version} %{buildroot}%{_javadocdir}/bouncycastle +popd + +%clean +[ "%{buildroot}" != / ] && rm -rf "%{buildroot}" + +%post +# TODO +#{ +#[ -f "/usr/lib/security/classpath.security" ] || continue +# +#sed -i '/^security\.provider\./d' "/usr/lib/security/classpath.security" +#count=0 +#for provider in $(ls /etc/java/security/security.d) +#do +# count=$((count + 1)) +# echo "security.provider.${count}=${provider#*-}" >> "/usr/lib/security/classpath.security" +#done +#} || : +%update_maven_depmap + +%postun +# TODO +#if [ $1 -eq 0 ] ; then +#{ +#[ -f "/usr/lib/security/classpath.security" ] || continue +# +#sed -i '/^security\.provider\./d' "/usr/lib/security/classpath.security" +# +#count=0 +#for provider in $(ls /etc/java/security/security.d) +#do +# count=$((count + 1)) +# echo "security.provider.${count}=${provider#*-}" >> "/usr/lib/security/classpath.security" +#done +#} || : +#fi +%update_maven_depmap + +%files +%defattr(-,root,root) +%{_sysconfdir}/java/security/security.d/2000-org.bouncycastle.jce.provider.BouncyCastleProvider +%{_javadir}/bcmail-%{version}.jar +%{_javadir}/bcmail.jar +%{_javadir}/bcpg-%{version}.jar +%{_javadir}/bcpg.jar +%{_javadir}/bcprov-%{version}.jar +%{_javadir}/bcprov.jar +%{_javadir}/bcprov-ext-%{version}.jar +%{_javadir}/bcprov-ext.jar +%{_javadir}/bctest-%{version}.jar +%{_javadir}/bctest.jar +%{_javadir}/bctsp-%{version}.jar +%{_javadir}/bctsp.jar +%{_javadir}/bcjce-%{version}.jar +%{_javadir}/bcjce.jar +%{_javadir}/bcjce-ext-%{version}.jar +%{_javadir}/bcjce-ext.jar +%{_javadir}-1.6.0/ +%{_javadir}-ext/ +%{_javadir}/gcj-endorsed +%{_mavenpomdir} +%{_mavendepmapfragdir} +%doc crypto-%{pkg_version}/build/artifacts/jdk1.6/lcrypto-jdk16-%{version}/*.html + +%files javadoc +%defattr(-,root,root) +%{_javadocdir}/bouncycastle-%{version} +%{_javadocdir}/bouncycastle + +%changelog +* Thu Nov 25 2010 gil 1.45-3mamba +- rebuilt devel +- add system java-pack200-ant-task support + +* Wed Mar 03 2010 gil 1.45-2mamba +- added %%post %%postun script +- renamed %{name} +- added maven poms + +* Thu Feb 25 2010 gil 1.45-1mamba +- update to 1.45 +- renamed for legacy %{name}145 +- added java-jcoverage support + +* Sat Jul 11 2009 gil 1.43-1mamba +- update to 1.43 +- renamed for legacy %{name}143 + +* Fri Apr 03 2009 gil 1.42-1mamba +- Initial package \ No newline at end of file