Simon IJskes - QCG wrote:
On 24-01-12 00:29, [email protected] wrote:
Commenced writing a bouncy castle self signed certificate generator
to replace DSTC JCSI.
You know you can generate self signed certificates with the java jdk
keytool?
Gr. Sim
I'm not sure if I've got the order correct although make reported
errors, I'm going to run the jtreg tests again anyway and see what breaks.
Cheers,
Peter.
bash-3.00$ make compile
/usr/jdk/jdk1.6.0_30/bin/javac \
-d . \
-classpath
.:../../../bouncy-castle/bcprov-jdk16-146.jar:../../../bouncy-castle/bcmail-jdk16-146.jar
\
*.java
bash-3.00$ ./run-ca.sh ./test-ca1.properties
bash-3.00$ ls keys
old test-ca1.cert test-ca1.key
bash-3.00$ ./run-ca.sh ./test-ca2.properties
bash-3.00$ ls
CA.class keys keystest-ca1.key
Makefile run-ca.sh test-ca2.properties
CA.java keystest-ca1.cert keystores
password test-ca1.properties
bash-3.00$ rm keyst
keystest-ca1.cert keystest-ca1.key keystores/
bash-3.00$ rm keystest-ca1.*
bash-3.00$ ls
CA.class keys Makefile
run-ca.sh test-ca2.properties
CA.java keystores password
test-ca1.properties
bash-3.00$ ls keys
old test-ca1.cert test-ca1.key test-ca2.cert test-ca2.key
bash-3.00$ ls keystores
test-ca.truststore test-user1A.keystore test-user1D.keystore
test-user2B.keystore test-user2E.keystore
test-ca1.truststore test-user1B.keystore test-user1E.keystore
test-user2C.keystore users.truststore
test-ca2.truststore test-user1C.keystore test-user2A.keystore
test-user2D.keystore
bash-3.00$ ls
CA.class keys Makefile
run-ca.sh test-ca2.properties
CA.java keystores password
test-ca1.properties
bash-3.00$ mv keystores keystores.old
bash-3.00$ mkdir keystores
bash-3.00$ ls keystores.old/
test-ca.truststore test-user1A.keystore test-user1D.keystore
test-user2B.keystore test-user2E.keystore
test-ca1.truststore test-user1B.keystore test-user1E.keystore
test-user2C.keystore users.truststore
test-ca2.truststore test-user1C.keystore test-user2A.keystore
test-user2D.keystore
bash-3.00$ ls keystores.old/users.truststore
keystores.old/users.truststore
bash-3.00$ ant create
Buildfile: build.xml does not exist!
Build failed
bash-3.00$ make create
rm -f keystores/*.*store
rm -rf requests
mkdir requests
for c in 1 2; do \
for u in A B C D E; do \
echo Creating Test User $c$u; \
/usr/jdk/jdk1.6.0_30/bin/keytool -storepass keypass -keypass
keypass -validity 3650 \
-genkey \
-keystore keystores/test-user$c$u.keystore \
-alias test-user$c$u \
-dname "CN=Test User $c$u, OU=Jini Group, O=Sun Microsystems
Inc, L=Burlington, ST=MA, C=US"; \
/usr/jdk/jdk1.6.0_30/bin/keytool -storepass keypass -keypass
keypass -validity 3650 \
-certreq \
-keystore keystores/test-user$c$u.keystore \
-alias test-user$c$u \
-file requests/test-user$c$u.request; \
done; \
done
Creating Test User 1A
Creating Test User 1B
Creating Test User 1C
Creating Test User 1D
Creating Test User 1E
Creating Test User 2A
Creating Test User 2B
Creating Test User 2C
Creating Test User 2D
Creating Test User 2E
bash-3.00$ make create_users_truststore
rm -f keystores/users.truststore
for c in 1 2; do \
for u in A B C D E; do \
/usr/jdk/jdk1.6.0_30/bin/keytool -storepass keypass -keypass
keypass -validity 3650 \
-export \
-keystore keystores/test-user$c$u.keystore \
-alias test-user$c$u -file /tmp/tmp.cert; \
/usr/jdk/jdk1.6.0_30/bin/keytool -storepass keypass -keypass
keypass -validity 3650 \
-import \
-keystore keystores/users.truststore \
-alias test-user$c$u -noprompt -file /tmp/tmp.cert; \
done; \
done
Certificate stored in file </tmp/tmp.cert>
Certificate was added to keystore
Certificate stored in file </tmp/tmp.cert>
Certificate was added to keystore
Certificate stored in file </tmp/tmp.cert>
Certificate was added to keystore
Certificate stored in file </tmp/tmp.cert>
Certificate was added to keystore
Certificate stored in file </tmp/tmp.cert>
Certificate was added to keystore
Certificate stored in file </tmp/tmp.cert>
Certificate was added to keystore
Certificate stored in file </tmp/tmp.cert>
Certificate was added to keystore
Certificate stored in file </tmp/tmp.cert>
Certificate was added to keystore
Certificate stored in file </tmp/tmp.cert>
Certificate was added to keystore
Certificate stored in file </tmp/tmp.cert>
Certificate was added to keystore
rm -f /tmp/tmp.cert
bash-3.00$ make import
for c in 1 2; do \
/usr/jdk/jdk1.6.0_30/bin/keytool -storepass keypass -keypass keypass
-validity 3650 \
-import \
-noprompt \
-keystore keystores/test-ca$c.truststore \
-alias test-ca$c \
-file keys/test-ca$c.cert; \
/usr/jdk/jdk1.6.0_30/bin/keytool -storepass keypass -keypass keypass
-validity 3650 \
-import \
-noprompt \
-keystore keystores/test-ca.truststore \
-alias test-ca$c \
-file keys/test-ca$c.cert; \
for u in A B C D E; do \
/usr/jdk/jdk1.6.0_30/bin/keytool -storepass keypass -keypass
keypass -validity 3650 \
-import \
-noprompt \
-keystore keystores/test-user$c$u.keystore \
-alias test-user$c$u \
-file requests/test-user$c$u.chain; \
done; \
done
Certificate was added to keystore
Certificate was added to keystore
keytool error: java.io.FileNotFoundException: requests/test-user1A.chain
(No such file or directory)
*** Error code 1
make: Fatal error: Command failed for target `import'
bash-3.00$ ls requests/
test-user1A.request test-user1C.request test-user1E.request
test-user2B.request test-user2D.request
test-user1B.request test-user1D.request test-user2A.request
test-user2C.request test-user2E.request
bash-3.00$