How to use keytool in silent mode?

book

Article ID: 223784

calendar_today

Updated On:

Products

CA Release Automation - Release Operations Center (Nolio)

Issue/Introduction

We are looking to automate the generation of creation and importing certificates via keytool. Is there a way to run keytool genkey and importcert in silent mode.

Environment

Release : 6.x

Component : CA Release Automation - Release Operations Center (Nolio) 

Sub Component: RAADM : CA RELEASE AUTOMATION ADMINISTRATION

Resolution

The commands listed below will execute keytool command with respective options in silent mode

  • keytool -genkey -keyalg RSA -keystore KEYSTORE.jks -alias ALIAS-NAME -storepass KEYSTORE-PASS -dname "CN=COMMON-NAME, OU=ORGANIZATION-UNIT, O=ORGANIZATION, L=CITY, ST=STATE, C=COUNTRY" -keypass KEY-PASS -validity 2048
  •  keytool -exportcert -alias ALIAS-NAME -keystore KEYSTORE.jks -file CERTIFICATE.crt -storepass KEYSTORE-PASS
  • keytool -importcert -alias ALIAS-NAME -file CERTIFICATE.crt -keystore TRUSTSTORE.jks -storepass KEYSTORE-PASS --noprompt