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
Java Policy的更多相关文章
- 使用 SecurityManager 和 Policy File 管理 Java 程序的权限
参考资料 该文中的内容来源于 Oracle 的官方文档.Oracle 在 Java 方面的文档是非常完善的.对 Java 8 感兴趣的朋友,可以从这个总入口 Java SE 8 Documentati ...
- java安全管理器SecurityManager入门
table { margin-left: 30px; width: 95%; border: 1px; border-collapse: collapse } img { border: 1px so ...
- java安全沙箱(四)之安全管理器及Java API
java是一种类型安全的语言,它有四类称为安全沙箱机制的安全机制来保证语言的安全性,这四类安全沙箱分别是: 类加载体系 .class文件检验器 内置于Java虚拟机(及语言)的安全特性 安全管理器及J ...
- Elasticsearch 2.X 版本Java插件开发简述
1:elasticsearch插件分类简述 2:Java插件开发要点 3:如何针对不同版本elasticsearch提供多版本的插件 4:插件具有外部依赖时遇到的一些问题(2016-09-07更新) ...
- JAVA+HTML
1.采用轻量级 JApplet . import java.awt.*; import javax.swing.JApplet; public class test extends JApplet{ ...
- access denied ("java.net.SocketPermission" "localhost:1527" "listen,resolve")
在开启derby服务出现该错误(测试hibernate 连接数据库时 使用myeclipse2014自带的数据库--windows->show view->other->Myecl ...
- DTrace to Troubleshoot Java Native Memory Problems
How to Use DTrace to Troubleshoot Java Native Memory Problems on Oracle Solaris 11 Hands-On Labs of ...
- java Permissions and Security Policy--官方文档
3 Permissions and Security Policy 3.1 The Permission Classes The permission classes represent access ...
- 基于 Java 2 运行时安全模型的线程协作--转
在 Java 2 之前的版本,运行时的安全模型使用非常严格受限的沙箱模型(Sandbox).读者应该熟悉,Java 不受信的 Applet 代码就是基于这个严格受限的沙箱模型来提供运行时的安全检查.沙 ...
随机推荐
- 【23.58%】【code forces 321E】Ciel and Gondolas
time limit per test4 seconds memory limit per test512 megabytes inputstandard input outputstandard o ...
- Android 使用Canvas在图片上绘制文字
一个小应用,在图片上绘制文字,以下是绘制文字的方法,并且能够实现自动换行,字体自动适配屏幕大小 private void drawNewBitmap(ImageView imageView, Stri ...
- AndroidStudio实现JNI的示例详解
1. NDK简介 Android NDK 是在SDK前面又加上了“原生”二字,即Native Development Kit,因此又被Google称为“NDK” 1.1 NDK产生的背景 Androi ...
- Android应用程序文件缓存getCacheDir()和getExternalCacheDir()
如果Android引用程序需要缓存临时文件,系统提供了一个可管理的“内部缓存”和一个不可管理的“外部缓存”,分别调用getCacheDir()和getExternalCacheDir()方法,可以从当 ...
- skip-slave-start的重要性
原来做复制的主机因为数据丢失需要重新创建复制环境,机器上已经有了主库数天前的备份,于是删除数据目录直接把备份放上去,结果发现复制没有抱错,show slave status一切正常,select co ...
- [Node.js] Identify memory leaks with nodejs-dashboard
In this lesson, I introduce a memory leak into our node.js application and show you how to identify ...
- SpringMVC拦截器-路径语法-略坑
项目中遇到一种场景,登录拦截器需要拦截.html后缀等动态请求,但是发现语法不对头. <mvc:interceptors> <mvc:interceptor> ...
- 学习鸟哥的Linux私房菜笔记(12)——系统监视2
四.控制进程 kill :语法 kill [-signal] PID 向进程传送一个特定的讯号,默认为15(终结) kill -l :列出所有可以由kill传递的讯号 1 :重启进程 2 : ...
- 【33.33%】【codeforces 586D】Phillip and Trains
time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard ou ...
- PAT练习题概览
PAT(pat.zju.edu.cn)是一个面向 C/C++程序的 Online Judge 系统.相比 ZOJ,HDOJ,POJ 等 ACM 题库,PAT 的题目非常基础,对于数据结构.算法的入门是 ...