< prev index next >

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

Print this page




  32 import static java.util.Locale.ENGLISH;
  33 
  34 import java.security.GeneralSecurityException;
  35 import java.security.spec.AlgorithmParameterSpec;
  36 import java.lang.reflect.*;
  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  * <pre>{@code
  50  *   permission <crypto permission class name>[, <algorithm name>
  51  *              [[, <exemption mechanism name>][, <maxKeySize>
  52  *              [, <AlgrithomParameterSpec class name>, <parameters
  53  *              for constructing an AlgrithomParameterSpec object>]]]];
  54  * }</pre>
  55  *
  56  * @author Sharon Liu
  57  *
  58  * @see java.security.Permissions
  59  * @see java.security.spec.AlgorithmParameterSpec
  60  * @see javax.crypto.CryptoPermission
  61  * @see javax.crypto.CryptoAllPermission
  62  * @see javax.crypto.CryptoPermissions
  63  * @since 1.4
  64  */
  65 
  66 final class CryptoPolicyParser {
  67 
  68     private Vector<GrantEntry> grantEntries;
  69 
  70     // Convenience variables for parsing
  71     private StreamTokenizer st;
  72     private int lookahead;
  73 




  32 import static java.util.Locale.ENGLISH;
  33 
  34 import java.security.GeneralSecurityException;
  35 import java.security.spec.AlgorithmParameterSpec;
  36 import java.lang.reflect.*;
  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  * <pre>{@code
  50  *   permission <crypto permission class name>[, <algorithm name>
  51  *              [[, <exemption mechanism name>][, <maxKeySize>
  52  *              [, <AlgorithmParameterSpec class name>, <parameters
  53  *              for constructing an AlgorithmParameterSpec object>]]]];
  54  * }</pre>
  55  *
  56  * @author Sharon Liu
  57  *
  58  * @see java.security.Permissions
  59  * @see java.security.spec.AlgorithmParameterSpec
  60  * @see javax.crypto.CryptoPermission
  61  * @see javax.crypto.CryptoAllPermission
  62  * @see javax.crypto.CryptoPermissions
  63  * @since 1.4
  64  */
  65 
  66 final class CryptoPolicyParser {
  67 
  68     private Vector<GrantEntry> grantEntries;
  69 
  70     // Convenience variables for parsing
  71     private StreamTokenizer st;
  72     private int lookahead;
  73 


< prev index next >