Sarav,
Some examples, sure that there are another ways to do, I'm not scriptmaster
take in mind that you are putting a password in the script!!!! Then you need to review generated file (cell_keyp12.txt) to check "until"
Windows:keytool -list -v -keystore C:\WebSphere\AppServer7\profiles\Dmgr01\config\cells\Cell01\key.p12 -storetype pkcs12 -storepass WebAS| findstr /N "Owner: Valid" > cell_keyp12.txt
Unix./keytool -list -v -keystore /opt/IBM/WebSphere/wp_profile/config/cells/portal7/nodes/portal7/key.p12 -storetype pkcs12 -storepass WebAS|grep -e "Owner:" -e "Valid" > cell_keyp12.txt
Hope this helps.
regards,