zoukankan      html  css  js  c++  java
  • Java Policy

    # What

    The policy for a Java™ programming language application environment (specifying which permissions are available for code from various sources, and executing as various principals) is represented by a Policy object. More specifically, it is represented by a Policy subclass providing an implementation of the abstract methods in the Policy class (which is in the java.security package).

    Java™ 编程语言应用环境的安全策略是以一个 Policy 对象表示的。具体来说,它表示一个 Policy 的子类,该子类提供了类 Policy(在 java.security 包中)的抽象方法的实现。 

    # Why

    Policy 定义了很多 Permission,包括文件读取、网络等。只需要一个文件,就可以相对简单有效的控制 Java 程序的安全。

    # How

    Example:

    // If the code is signed by "Duke", grant it read/write access to all 
    // files in /tmp:
    grant signedBy "Duke" {
        permission java.io.FilePermission "/tmp/*", "read,write";
    };
    
    // Grant everyone the following permission:
    grant { 
        permission java.util.PropertyPermission "java.vendor", "read";
    };

    # Reference

    http://docs.oracle.com/javase/8/docs/technotes/guides/security/PolicyFiles.html

  • 相关阅读:
    a 超链接标签
    select(下拉标签和textarea(文本框)
    input标签
    input 标签
    div 标签
    body 标签
    STL__网上资料
    STL_iterator返回值
    STL_算法_中使用的函数对象
    STL_std::iterator
  • 原文地址:https://www.cnblogs.com/Piers/p/6549595.html
Copyright © 2011-2022 走看看