#!/bin/sh

pwd=`pwd`
eloc=`which abac_prover | sed 's/\/abac_prover//'`
if [ "$eloc" = "" ]; then
  echo "ERROR: abac_prover is not in the search path!!!"
  exit 1
fi

keyloc=$pwd

ice=`creddy --keyid --cert $keyloc/IceCream_ID.pem`
chocolate_prin=`creddy --keyid --cert $keyloc/Chocolate_ID.pem`

delicious="$ice.delicious"

#[keyid:Acme].role:preferred_customer <-?- [keyid:Coyote]
#isMember(pCoyote, role(pAcme,preferred_customer), C).
echo "  "
echo "===good============ IceCream.delicious <- Chocolate"
$eloc/abac_prover  --keystore $keyloc \
      --role "$delicious" --principal "$chocolate_prin"

