diff options
author | Endi S. Dewata <edewata@redhat.com> | 2016-06-16 21:17:59 +0200 |
---|---|---|
committer | Endi S. Dewata <edewata@redhat.com> | 2016-06-16 21:25:52 +0200 |
commit | 1611030335695bbc22ea7d965e97415aeacc44a3 (patch) | |
tree | 648b115f942fd0b9faee5a2abfe499a979ee0934 /scripts | |
parent | 78373a1549e5ce8e2db73eafc6d6019110273c8a (diff) | |
download | pki-dev-1611030335695bbc22ea7d965e97415aeacc44a3.tar.gz pki-dev-1611030335695bbc22ea7d965e97415aeacc44a3.tar.xz pki-dev-1611030335695bbc22ea7d965e97415aeacc44a3.zip |
Added CA agent script.
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/ca-agent-setup.sh | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/scripts/ca-agent-setup.sh b/scripts/ca-agent-setup.sh new file mode 100755 index 0000000..a54621a --- /dev/null +++ b/scripts/ca-agent-setup.sh @@ -0,0 +1,15 @@ +#!/bin/sh -x + +pki -d ~/.dogtag/pki-tomcat/ca/alias -c Secret123 -n caadmin ca-user-add caagent --fullName "CA Agent" +pki -d ~/.dogtag/pki-tomcat/ca/alias -c Secret123 -n caadmin ca-group-member-add "Certificate Manager Agents" caagent + +REQUEST_ID=`pki -c Secret123 client-cert-request uid=caagent | grep "Request ID:" | awk -F ': ' '{print $2;}'` +echo Request ID: $REQUEST_ID + +CERT_ID=`pki -d ~/.dogtag/pki-tomcat/ca/alias -c Secret123 -n caadmin ca-cert-request-review --action approve $REQUEST_ID | grep "Certificate ID:" | awk -F ': ' '{print $2;}'` +echo Certificate ID: $CERT_ID + +pki -d ~/.dogtag/pki-tomcat/ca/alias -c Secret123 -n caadmin ca-user-cert-add caagent --serial $CERT_ID +pki -c Secret123 client-cert-import caagent --serial $CERT_ID + +pki -c Secret123 client-cert-show caagent --pkcs12 caagent.p12 --pkcs12-password Secret123 |