Appendix D: Jurisdiction Policy File Format
JCE represents its jurisdiction policy files as J2SE-style policy files with corresponding permission statements. As described in Default Policy Implementation and Policy File Syntax, a J2SE policy file specifies what permissions are allowed for code from specified code sources. A permission represents access to a system resource. In the case of JCE, the resources are cryptography algorithms, and code sources do not need to be specified, because the cryptographic restrictions apply to all code.
grant entry containing one
or more permission
entries.grant {
<permission entries>;
};permission <crypto permission class name>[ <alg_name>
[[, <exemption mechanism name>][, <maxKeySize>
[, <AlgorithmParameterSpec class name>,
<parameters for constructing an
AlgorithmParameterSpec object>]]]];grant {
permission javax.crypto.CryptoPermission "Blowfish", 64;
. . .;
};A permission entry must begin with the word permission.
The <crypto permission class name> in the template
shown would actually be a specific permission class name, such as javax.crypto.CryptoPermission.
A crypto permission class reflects the ability of an application/applet
to use certain algorithms with certain key sizes in certain environments.
There are two crypto permission classes: CryptoPermission and CryptoAllPermission.
The special CryptoAllPermission class implies all
cryptography-related permissions, that is, it specifies that there
are no cryptography-related restrictions.
The <alg_name>, when utilized, is a quoted string specifying the standard name (see Appendix A) of a cryptography algorithm, such as DES or RSA.
The <exemption mechanism name>, when specified, is a quoted string indicating an exemption mechanism which, if enforced, enables a reduction in cryptographic restrictions. Exemption mechanism names that can be used include KeyRecovery KeyEscrow, and KeyWeakening.
<maxKeySize> is an integer specifying the maximum key size (in bits) allowed for the specified algorithm.
For some algorithms it may not be sufficient to specify the algorithm strength in terms of just a
key size. For example, in the case of the RC5 algorithm, the number of rounds must also be
considered. For algorithms whose strength needs to be expressed as more than a key size, the
permission entry should also specify an AlgorithmParameterSpec class name (such as
javax.crypto.spec.RC5ParameterSpec) and a list of parameters for constructing the
specified AlgorithmParameterSpec object.
Items that appear in a permission entry must appear in the specified order. An entry is terminated with a semicolon.
Case is unimportant for the identifiers (grant, permission)
but is significant for the <crypto permission class name> or
for any string that is passed in as a value.
* for an <alg_name> option means all algorithms.