summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEndi S. Dewata <edewata@redhat.com>2017-11-14 20:54:55 -0600
committerEndi S. Dewata <edewata@redhat.com>2017-11-14 20:54:55 -0600
commit8ebb6025dd0f585f6df3fd9308b10f9559c0a067 (patch)
tree66f2618466b3dec95d44110da2e222a70828a083
parent332135c330e7cbe687c80aab00a0d8dac3902055 (diff)
downloadpki-dev-8ebb6025dd0f585f6df3fd9308b10f9559c0a067.zip
pki-dev-8ebb6025dd0f585f6df3fd9308b10f9559c0a067.tar.gz
pki-dev-8ebb6025dd0f585f6df3fd9308b10f9559c0a067.tar.xz
Updated CA and KRA scripts for HSM.
-rwxr-xr-xscripts/ca-nfast-create-step1.sh66
-rwxr-xr-xscripts/ca-nfast-create-step2.sh4
-rwxr-xr-xscripts/ca-nfast-create.sh20
-rwxr-xr-xscripts/kra-create.sh10
-rwxr-xr-xscripts/kra-nfast-create.sh65
5 files changed, 139 insertions, 26 deletions
diff --git a/scripts/ca-nfast-create-step1.sh b/scripts/ca-nfast-create-step1.sh
index 483fdbb..0803db8 100755
--- a/scripts/ca-nfast-create-step1.sh
+++ b/scripts/ca-nfast-create-step1.sh
@@ -1,9 +1,63 @@
#!/bin/sh -x
-#pkispawn -vv -f ca-nfast-step1.cfg -s CA
-pkispawn -vv -f ca-nfast.cfg -s CA --skip-configuration
+mkdir -p tmp
-#/bin/cp /root/.dogtag/pki-tomcat/ca_admin.cert .
-#/bin/cp /root/.dogtag/pki-tomcat/ca_admin_cert.p12 .
-#/bin/cp /root/.dogtag/pki-tomcat/ca/pkcs12_password.conf ca_admin_cert.txt
-#echo $HOSTNAME > master.txt
+#USER=`cat user.txt`
+TOKEN=softcard
+
+cat > tmp/ca-nfast.cfg << EOF
+[DEFAULT]
+pki_pin=Secret.123
+pki_hsm_enable=True
+
+pki_hsm_libfile=/opt/nfast/toolkits/pkcs11/libcknfast.so
+pki_hsm_modulename=nfast
+pki_token_name=$TOKEN
+pki_token_password=Secret.123
+pki_pin=Secret.123
+
+[CA]
+pki_admin_email=caadmin@example.com
+pki_admin_name=caadmin
+pki_admin_nickname=caadmin
+pki_admin_password=Secret.123
+pki_admin_uid=caadmin
+
+pki_client_database_password=Secret.123
+pki_client_database_purge=False
+pki_client_pkcs12_password=Secret.123
+
+pki_ds_base_dn=dc=ca,dc=pki,dc=example,dc=com
+pki_ds_database=ca
+pki_ds_password=Secret.123
+
+pki_security_domain_name=EXAMPLE
+
+pki_ca_signing_nickname=ca_signing
+#pki_ca_signing_nickname=$USER/%(pki_instance_name)s/ca_signing
+#pki_ca_signing_token=internal
+pki_ca_signing_token=$TOKEN
+
+pki_ocsp_signing_nickname=ca_ocsp_signing
+#pki_ocsp_signing_nickname=$USER/%(pki_instance_name)s/ca_ocsp_signing
+#pki_ocsp_signing_token=internal
+pki_ocsp_signing_token=$TOKEN
+
+pki_audit_signing_nickname=ca_audit_signing
+#pki_audit_signing_nickname=$USER/%(pki_instance_name)s/ca_audit_signing
+#pki_audit_signing_token=internal
+pki_audit_signing_token=$TOKEN
+
+pki_sslserver_nickname=sslserver
+#pki_sslserver_nickname=$USER/%(pki_instance_name)s/sslserver/%(pki_hostname)s
+#pki_sslserver_token=internal
+pki_sslserver_token=$TOKEN
+
+pki_subsystem_nickname=subsystem
+#pki_subsystem_nickname=$USER/%(pki_instance_name)s/subsystem
+#pki_subsystem_token=internal
+pki_subsystem_token=$TOKEN
+EOF
+
+#pkispawn -f ca-nfast-step1.cfg -s CA
+pkispawn -f tmp/ca-nfast.cfg -s CA --skip-configuration
diff --git a/scripts/ca-nfast-create-step2.sh b/scripts/ca-nfast-create-step2.sh
index 8afa365..d35e39d 100755
--- a/scripts/ca-nfast-create-step2.sh
+++ b/scripts/ca-nfast-create-step2.sh
@@ -1,7 +1,7 @@
#!/bin/sh -x
-#pkispawn -vv -f ca-nfast-step2.cfg -s CA
-pkispawn -vv -f ca-nfast.cfg -s CA --skip-installation
+#pkispawn -f ca-nfast-step2.cfg -s CA
+pkispawn -f tmp/ca-nfast.cfg -s CA --skip-installation
#/bin/cp /root/.dogtag/pki-tomcat/ca_admin.cert .
#/bin/cp /root/.dogtag/pki-tomcat/ca_admin_cert.p12 .
diff --git a/scripts/ca-nfast-create.sh b/scripts/ca-nfast-create.sh
index ca52316..d5275e9 100755
--- a/scripts/ca-nfast-create.sh
+++ b/scripts/ca-nfast-create.sh
@@ -2,7 +2,7 @@
mkdir -p tmp
-USER=`cat user.txt`
+#USER=`cat user.txt`
TOKEN=softcard
cat > tmp/ca-nfast.cfg << EOF
@@ -36,27 +36,27 @@ pki_security_domain_name=EXAMPLE
pki_ca_signing_nickname=ca_signing
#pki_ca_signing_nickname=$USER/%(pki_instance_name)s/ca_signing
#pki_ca_signing_token=internal
-#pki_ca_signing_token=$TOKEN
+pki_ca_signing_token=$TOKEN
pki_ocsp_signing_nickname=ca_ocsp_signing
#pki_ocsp_signing_nickname=$USER/%(pki_instance_name)s/ca_ocsp_signing
#pki_ocsp_signing_token=internal
-#pki_ocsp_signing_token=$TOKEN
+pki_ocsp_signing_token=$TOKEN
pki_audit_signing_nickname=ca_audit_signing
#pki_audit_signing_nickname=$USER/%(pki_instance_name)s/ca_audit_signing
#pki_audit_signing_token=internal
-#pki_audit_signing_token=$TOKEN
+pki_audit_signing_token=$TOKEN
-pki_ssl_server_nickname=sslserver
-#pki_ssl_server_nickname=$USER/%(pki_instance_name)s/sslserver/%(pki_hostname)s
-#pki_ssl_server_token=internal
-#pki_ssl_server_token=$TOKEN
+pki_sslserver_nickname=sslserver
+#pki_sslserver_nickname=$USER/%(pki_instance_name)s/sslserver/%(pki_hostname)s
+#pki_sslserver_token=internal
+pki_sslserver_token=$TOKEN
pki_subsystem_nickname=subsystem
#pki_subsystem_nickname=$USER/%(pki_instance_name)s/subsystem
#pki_subsystem_token=internal
-#pki_subsystem_token=$TOKEN
+pki_subsystem_token=$TOKEN
EOF
-pkispawn -vv -f tmp/ca-nfast.cfg -s CA
+pkispawn -f tmp/ca-nfast.cfg -s CA
diff --git a/scripts/kra-create.sh b/scripts/kra-create.sh
index 09b9a93..85a16cc 100755
--- a/scripts/kra-create.sh
+++ b/scripts/kra-create.sh
@@ -9,14 +9,13 @@ cat > tmp/kra.cfg << EOF
pki_pin=Secret.123
[KRA]
-#pki_admin_cert_file=/root/.dogtag/pki-tomcat/ca_admin.cert
+pki_import_admin_cert=True
+pki_admin_cert_file=/root/.dogtag/pki-tomcat/ca_admin.cert
-#pki_import_admin_cert=False
#pki_import_admin_pkcs12_file=/root/.dogtag/pki-tomcat/ca_admin_cert.p12
#pki_import_admin_pkcs12_password=Secret.123
#pki_import_admin_pkcs12_nickname=caadmin
-pki_import_admin_cert=False
pki_admin_email=kraadmin@example.com
pki_admin_name=kraadmin
pki_admin_nickname=kraadmin
@@ -29,12 +28,9 @@ pki_admin_nickname=kraadmin
pki_admin_password=Secret.123
pki_admin_uid=kraadmin
-#pki_backup_keys=True
-#pki_backup_password=Secret.123
-
pki_client_database_password=Secret.123
pki_client_pkcs12_password=Secret.123
-#pki_client_database_purge=False
+pki_client_database_purge=False
#pki_clone_pkcs12_password=Secret.123
diff --git a/scripts/kra-nfast-create.sh b/scripts/kra-nfast-create.sh
index 42e9699..01e098b 100755
--- a/scripts/kra-nfast-create.sh
+++ b/scripts/kra-nfast-create.sh
@@ -1,3 +1,66 @@
#!/bin/sh -x
-pkispawn -vvv -f kra-nfast.cfg -s KRA
+mkdir -p tmp
+
+CA_HOSTNAME=`cat tmp/ca.hostname`
+#USER=`cat user.txt`
+TOKEN=softcard
+
+cat > tmp/kra-nfast.cfg << EOF
+[DEFAULT]
+pki_pin=Secret.123
+pki_hsm_enable=True
+
+pki_hsm_libfile=/opt/nfast/toolkits/pkcs11/libcknfast.so
+pki_hsm_modulename=nfast
+pki_token_name=$TOKEN
+pki_token_password=Secret.123
+pki_pin=Secret.123
+
+[KRA]
+pki_admin_email=kraadmin@example.com
+pki_admin_name=kraadmin
+pki_admin_nickname=kraadmin
+pki_admin_password=Secret.123
+pki_admin_uid=kraadmin
+
+pki_client_database_password=Secret.123
+pki_client_pkcs12_password=Secret.123
+pki_client_database_purge=False
+
+pki_ds_base_dn=dc=kra,dc=pki,dc=example,dc=com
+pki_ds_database=kra
+pki_ds_password=Secret.123
+
+pki_security_domain_hostname=$CA_HOSTNAME
+pki_security_domain_name=EXAMPLE
+pki_security_domain_user=caadmin
+pki_security_domain_password=Secret.123
+
+pki_storage_nickname=kra_storage
+#pki_storage_nickname=$USER/%(pki_instance_name)s/kra_storage
+#pki_storage_token=internal
+pki_storage_token=$TOKEN
+
+pki_transport_nickname=kra_transport
+#pki_transport_nickname=$USER/%(pki_instance_name)s/kra_transport
+#pki_transport_token=internal
+pki_transport_token=$TOKEN
+
+pki_audit_signing_nickname=kra_audit_signing
+#pki_audit_signing_nickname=$USER/%(pki_instance_name)s/kra_audit_signing
+#pki_audit_signing_token=internal
+pki_audit_signing_token=$TOKEN
+
+pki_sslserver_nickname=sslserver
+#pki_sslserver_nickname=$USER/%(pki_instance_name)s/sslserver/%(pki_hostname)s
+#pki_sslserver_token=internal
+pki_sslserver_token=$TOKEN
+
+pki_subsystem_nickname=subsystem
+#pki_subsystem_nickname=$USER/%(pki_instance_name)s/subsystem
+#pki_subsystem_token=internal
+pki_subsystem_token=$TOKEN
+EOF
+
+pkispawn -f tmp/kra-nfast.cfg -s KRA