#! /bin/ksh

# Step 1.  Create the Bela identity, as a trusted identity

javakey -cs Bela true

# Step 2.  Generate a keypair for Bela, and store the public key in a file named
# Bela_pub and the private key in a file named Bela_priv

javakey -gk Bela DSA 512 Bela_pub Bela_priv

# Step 3.  Generate an x509 certificate for Bela, and store it in the file
# named Bela.x509.   This output file name is given in the directive file
# named cert_directive_Bela. 

javakey -gc cert_directive_Bela 

# Step 4.   Create the archive. 

jar cf Gmp.jar GmpTest.class Sock.class

# Step 5.   Sign the archive, using the parameters given in sign_directive_Bela. 

javakey -gs sign_directive_Bela Gmp.jar

# Step 6.   Move the signed archive to a file suffixed in .jar. 

mv Gmp.jar.sig Gmp.jar

# Step 7 .   Show the contents of the identity database. 

echo " "
echo "Contents of the identity database are: "
javakey -ld


