src/share/classes/javax/crypto/CryptoPolicyParser.java

Print this page




  37 
  38 /**
  39  * JCE has two pairs of jurisdiction policy files: one represents U.S. export
  40  * laws, and the other represents the local laws of the country where the
  41  * JCE will be used.
  42  *
  43  * The jurisdiction policy file has the same syntax as JDK policy files except
  44  * that JCE has new permission classes called javax.crypto.CryptoPermission
  45  * and javax.crypto.CryptoAllPermission.
  46  *
  47  * The format of a permission entry in the jurisdiction policy file is:
  48  *
  49  *   permission <crypto permission class name>[, <algorithm name>
  50  *              [[, <exemption mechanism name>][, <maxKeySize>
  51  *              [, <AlgrithomParameterSpec class name>, <parameters
  52  *              for constructing an AlgrithomParameterSpec object>]]]];
  53  *
  54  * @author Sharon Liu
  55  *
  56  * @see java.security.Permissions
  57  * @see java.security.spec.AlgrithomParameterSpec
  58  * @see javax.crypto.CryptoPermission
  59  * @see javax.crypto.CryptoAllPermission
  60  * @see javax.crypto.CryptoPermissions
  61  * @since 1.4
  62  */
  63 
  64 final class CryptoPolicyParser {
  65 
  66     private Vector<GrantEntry> grantEntries;
  67 
  68     // Convenience variables for parsing
  69     private StreamTokenizer st;
  70     private int lookahead;
  71 
  72     /**
  73      * Creates a CryptoPolicyParser object.
  74      */
  75     CryptoPolicyParser() {
  76         grantEntries = new Vector<GrantEntry>();
  77     }




  37 
  38 /**
  39  * JCE has two pairs of jurisdiction policy files: one represents U.S. export
  40  * laws, and the other represents the local laws of the country where the
  41  * JCE will be used.
  42  *
  43  * The jurisdiction policy file has the same syntax as JDK policy files except
  44  * that JCE has new permission classes called javax.crypto.CryptoPermission
  45  * and javax.crypto.CryptoAllPermission.
  46  *
  47  * The format of a permission entry in the jurisdiction policy file is:
  48  *
  49  *   permission <crypto permission class name>[, <algorithm name>
  50  *              [[, <exemption mechanism name>][, <maxKeySize>
  51  *              [, <AlgrithomParameterSpec class name>, <parameters
  52  *              for constructing an AlgrithomParameterSpec object>]]]];
  53  *
  54  * @author Sharon Liu
  55  *
  56  * @see java.security.Permissions
  57  * @see java.security.spec.AlgorithmParameterSpec
  58  * @see javax.crypto.CryptoPermission
  59  * @see javax.crypto.CryptoAllPermission
  60  * @see javax.crypto.CryptoPermissions
  61  * @since 1.4
  62  */
  63 
  64 final class CryptoPolicyParser {
  65 
  66     private Vector<GrantEntry> grantEntries;
  67 
  68     // Convenience variables for parsing
  69     private StreamTokenizer st;
  70     private int lookahead;
  71 
  72     /**
  73      * Creates a CryptoPolicyParser object.
  74      */
  75     CryptoPolicyParser() {
  76         grantEntries = new Vector<GrantEntry>();
  77     }