diff options
| author | Alex Rudyy <orudyy@apache.org> | 2015-03-20 10:41:57 +0000 |
|---|---|---|
| committer | Alex Rudyy <orudyy@apache.org> | 2015-03-20 10:41:57 +0000 |
| commit | 87629732fae81a4e9ac1a500e878dc3c57dc3ab8 (patch) | |
| tree | c75342b598f1174f561b48c484b42012dfeb49d3 /qpid/java | |
| parent | 573d7d52e06576675ecc23da5f4bc57890e6fc0c (diff) | |
| download | qpid-python-87629732fae81a4e9ac1a500e878dc3c57dc3ab8.tar.gz | |
NO-JIRA: Add Apache licenses to scripts generating keystores/trustores/CA and improve instruction messages issued by scripts
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1667982 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/java')
| -rwxr-xr-x | qpid/java/test-profiles/test_resources/ssl/generate-java-keystores.sh | 29 | ||||
| -rwxr-xr-x | qpid/java/test-profiles/test_resources/ssl/generate-root-ca.sh | 40 |
2 files changed, 54 insertions, 15 deletions
diff --git a/qpid/java/test-profiles/test_resources/ssl/generate-java-keystores.sh b/qpid/java/test-profiles/test_resources/ssl/generate-java-keystores.sh index cece3b63d1..fe27844465 100755 --- a/qpid/java/test-profiles/test_resources/ssl/generate-java-keystores.sh +++ b/qpid/java/test-profiles/test_resources/ssl/generate-java-keystores.sh @@ -1,4 +1,23 @@ -#!/bin/bash +#!/usr/bin/env bash +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# + echo "Remove existing java broker keystore" rm java_broker_keystore.jks echo "Re-create java broker keystore by importing RootCA certificate" @@ -9,7 +28,7 @@ echo "Export certificate signing request" keytool -certreq -alias java-broker -sigalg SHA1withRSA -keystore java_broker_keystore.jks -storepass password -v -file java-broker.req echo "Sign certificate by entering:" echo " n for 'Is this a CA certificate [y/N]?'" -echo " 0 for 'Enter the path length constraint, enter to skip [<0 for unlimited path]: >'" +echo " [Enter] for 'Enter the path length constraint, enter to skip [<0 for unlimited path]: >'" echo " n for 'Is this a critical extension [y/N]?'" echo " password which was specified on creation root CA database." certutil -C -d CA_db -c "MyRootCA" -a -i java-broker.req -o java-broker.crt -2 -6 --extKeyUsage serverAuth -v 60 -Z SHA1 @@ -55,7 +74,7 @@ keytool --list --keystore java_client_keystore.jks -storepass password read -p "Press [Enter] key to continue..." echo "Remove existing client truststore" rm java_client_truststore.jks -echo "Re-create existing client truststore by importing RootCA certificate" +echo "Re-create client truststore by importing RootCA certificate" keytool -import -v -keystore java_client_truststore.jks -storepass password -alias RootCA -file CA_db/rootca.crt echo "List entries in client trusttore" keytool --list --keystore java_client_truststore.jks -storepass password @@ -63,7 +82,7 @@ keytool --list --keystore java_client_truststore.jks -storepass password read -p "Press [Enter] key to continue..." echo "Remove existing broker truststore" rm java_broker_truststore.jks -echo "Re-create existing broker truststore by importing RootCA certificate" +echo "Re-create broker truststore by importing RootCA certificate" keytool -import -v -keystore java_broker_truststore.jks -storepass password -alias RootCA -file CA_db/rootca.crt echo "List entries in broker truststore" keytool --list --keystore java_broker_truststore.jks -storepass password @@ -71,7 +90,7 @@ keytool --list --keystore java_broker_truststore.jks -storepass password read -p "Press [Enter] key to continue..." echo "Remove existing broker peerstore" rm java_broker_peerstore.jks -echo "Re-create existing broker peerstore by importing app1 certificate" +echo "Re-create broker peerstore by importing app1 certificate" keytool -import -v -keystore java_broker_peerstore.jks -storepass password -alias app1 -file app1.crt echo "List entries in broker peerstore" keytool --list --keystore java_broker_peerstore.jks -storepass password diff --git a/qpid/java/test-profiles/test_resources/ssl/generate-root-ca.sh b/qpid/java/test-profiles/test_resources/ssl/generate-root-ca.sh index c765cef6b8..ca14727e5e 100755 --- a/qpid/java/test-profiles/test_resources/ssl/generate-root-ca.sh +++ b/qpid/java/test-profiles/test_resources/ssl/generate-root-ca.sh @@ -1,12 +1,32 @@ +#!/usr/bin/env bash +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# + echo "Create a new certificate database for root CA" rm CA_db/* certutil -N -d CA_db -echo "Create the self-signed Root CA certificate" -echo "Enter the password you specified when creating the root CA database." -echo "y for 'Is this a CA certificate [y/N]?'” -echo "Press enter for 'Enter the path length constraint, enter to skip [<0 for unlimited path]: >'" -echo "n for 'Is this a critical extension [y/N]?'” +echo "Create the self-signed Root CA certificate by entering:" +echo " password which was specified on creation of root CA database." +echo " y for 'Is this a CA certificate [y/N]?'" +echo " [Enter] for 'Enter the path length constraint, enter to skip [<0 for unlimited path]: >'" +echo " n for 'Is this a critical extension [y/N]?'" certutil -S -d CA_db -n "MyRootCA" -s "CN=MyRootCA,O=ACME,ST=Ontario,C=CA" -t "CT,," -x -2 -Z SHA1 -v 60 echo "Extract the CA certificate from the CA’s certificate database to a file." certutil -L -d CA_db -n "MyRootCA" -a -o CA_db/rootca.crt @@ -19,11 +39,11 @@ echo "Import the CA certificate into the broker’s certificate database" certutil -A -d server_db -n "MyRootCA" -t "TC,," -a -i CA_db/rootca.crt echo "Create the server certificate request" certutil -R -d server_db -s "CN=localhost.localdomain,O=ACME,ST=Ontario,C=CA" -a -o server_db/server.req -Z SHA1 -echo "Sign and issue a new server certificate" -echo "n for 'Is this a CA certificate [y/N]?'" -echo "-1 for 'Enter the path length constraint, enter to skip [<0 for unlimited path]: >'" -echo "n' for 'Is this a critical extension [y/N]?'" -echo "enter the password you specified when creating the root CA database." +echo "Sign and issue a new server certificate by entering:" +echo " n for 'Is this a CA certificate [y/N]?'" +echo " '-1' for 'Enter the path length constraint, enter to skip [<0 for unlimited path]: >'" +echo " n for 'Is this a critical extension [y/N]?'" +echo " password which was specified on creation of root CA database." certutil -C -d CA_db -c "MyRootCA" -a -i server_db/server.req -o server_db/server.crt -2 -6 --extKeyUsage serverAuth -v 60 -Z SHA1 echo "Import signed certificate to the broker’s certificate database" certutil -A -d server_db -n localhost.localdomain -a -i server_db/server.crt -t ",," |
