All jar files of an applet deployed on a remote Web server must be signed with the same certificate before the applet is deployed. The following steps describe how to generate a test certificate for signing the jar files. We will use the tool called keytool which is included in the Oracle's Java Development Kit.
keytool -genkey -alias myAlias -keystore keystore.pkcs -storetype PKCS12 -keyalg RSA -keysize 2048 -dname "cn=your name here, ou=organization unit name, o=organization name, c=US"
This command creates a keystore file called keystore.pkcs. The certificate attributes are specified in the dname parameter: common name of the certificate, organization unit name (for example Purchasing or Sales Department), organization name, country.
keytool -selfcert -alias myAlias -keystore keystore.pkcs -storetype PKCS12
keytool -export -alias myAlias -keystore keystore.pkcs -storetype PKCS12 -file certfile.cer
keytool -printcert -file certfile.cer