摘自:Inside Java 2 Platform Security - 2nd Ed,published by Addison Wesley,2003

8.4.1 Subjects and Principals
Users often depend on computing services to assist them in performing work. Furthermore, services themselves might subsequently interact with other services.

JAAS uses the term subject to refer to a system entity, such as a user or a computing service.
JAAS用术语subject来表示系统实体,比如一个用户或者一个计算服务。

To identify the subjects with which it interacts, a computing service typically relies on names. However, a subject might not have the same name for each service and, in fact, may even have a different name for each individual service.
服务通常以来名字来标识那些和它交互的subject.然而一个subject一般不会用同一个名字面向每个服务,实际上,甚至subject会用各不相同的名字面向每个服务。

The term principal represents a name associated with a subject [71]. Because a subject may have multiple names, potentially one for each service with which it interacts, a subject in JAAS comprises a set of principals.
术语principal表示和一个subject关联的名字。因为一个subject可以有多个名字,以便和不同的服务交互时采用不同的名字,一个subject由一组principal组成。

Once a subject is authenticated, an instance of javax.security.auth.Subject is created to represent that subject and is populated with objects that implement the java.security.Principal interface.
一旦subject通过了认证,系统就会生成一个javax.security.auth.Subject的实例来表示该subject,并且加入一些实现java.security.Principal接口的对象到Subject实例中。

Authentication represents the process by which one system entity verifies the identity of another and must be performed in a secure fashion; otherwise, an intruder may impersonate others to gain access to a system.
认证就是一个系统实体验证另一个实体的身份的过程,并且必须在安全的方式下进行;否则入侵者就会伪装成别的实体进入系统。

Authentication typically involves the subject demonstrating possession of some form of evidence to prove its identity. Such evidence may be information only the subject would be likely to know or have, such as a password or smart card, or that only the subject could produce, such as signed data using a private key.
认证时,通常是一个subject出示其某种证据来证明它的身份。这些证据可以是这个subject知道或者拥有的信息,比如密码或者智能卡。。。

When it attempts to authenticate to a service, a subject typically provides the proof of its identity along with its name. If the authentication attempt succeeds, the service associates a service-specific Principal, using the given name, with the Subject. Applications and services can determine the identity of the Subject simply by referencing the relevant Principal associated with that Subject.
当它试图通过某个服务的认证时,subject通常随它的名字一起提供它身份的证明。如果认证通过了,服务会将一个特属于该服务的Principal和Subject关联,名字和subject请求认证时的名字相同。应用程序和服务可以通过参考Subject关联的Principal来识别Subject的身份。

Reliance on named principals usually derives from the fact that a service implements a conventional access control model of security [69]. This model allows a service to define a set of protected resources and the conditions under which named principals may access those resources.
命名的principals之所以值得信赖,源自服务一般都按惯例实现同一种访问控制安全模型。这个模型允许服务定义一个受保护的资源的集合,以及命名的principal可以访问这些资源的条件。

Both KeyNote [14] and SPKI [34] have focused on the limitations of using conventional names in large distributed systems for access control and note that public keys, instead, provide a more practical and scalable name representation.
JAAS and SPKI do not impose any restrictions on principal names. Localized environments that have limited namespaces or that do not rely on public-key cryptography may define principals that have conventional names.
Large-scale distributed systems may use principals that allow the principal name to be a public key.

8.4.2 Credentials
In addition to Principal information, some services may want to associate other security-related attributes and data with a Subject.
JAAS calls such generic security-related attributes credentials.
除了Principal的信息,有些服务还需要Subjec的其它一些安全相关的属性和数据。JAAS用术语credential表示这些平常的安全有关的属性。

A credential may contain information that could be used to authenticate the subject to additional services.
Some common types of credentials are passwords, Kerberos tickets [87] and public-key certificates.
一个credential可能包含该subject到其它的服务认证的信息。credentail通常是密码,Kerberos tickets以及公钥证书。

Many of these credential forms are used in environments that support single sign-on.

Credentials may also contain data that simply enables the subject to perform certain activities. Cryptographic keys,
for example, represent credentials that enable the subject to sign or encrypt data. In JAAS, credentials may be any type
 of object. Therefore, existing credential implementations, such as java.security.cert.Certificate, can be easily
 incorporated into JAAS. Third-party credential implementations may also be plugged in to the JAAS framework.
credentials也可以包含一些数据,以便subject可以执行一些特定点活动。比如包含Cryptographic keys, subject就可以签名或者加密数据。
在JAAS框架中,credential可以使任何类型的对象。

Although Kerberos tickets and cryptographic keys exemplify common types of credentials,
credentials can represent a wider range of security-related data.

Applications running on behalf of subjects must coordinate with the services on which they depend so as to
agree on the kinds of credentials that are needed and recognized during their interactions.
Thus, some credentials might be standard or well recognized, whereas others might be application and service specific.

In addition, credential implementations do not necessarily have to contain the security-related data;
they might simply reference that data. This occurs when the data must physically reside on a separate server or hardware device,
such as private keys on a smart card.

A subject must successfully authenticate to a service to obtain credentials. On successful authentication,
the service creates the appropriate credential object and associates it with the Subject.
Once a Subject has been populated with credentials, applications considered to be running on behalf of the subject may,
with the proper permissions, then access and use those credentials.
一个subject必须成功通过服务的认证,才能拿到credentials.

JAAS does not impose any restrictions about credential delegation to third parties.
Rather, JAAS either allows each credential implementation to specify its own delegation protocol, as Kerberos does,
or leaves delegation decisions up to the applications.

JAAS divides each Subject's credentials into two sets. One set contains the subject's public credentials,
such as public-key certificates. The other set stores the subject's private credentials, such as private keys,
Kerberos tickets, encryption keys, passwords, and so on.

To access a Subject's public credentials, no permissions are required. However,
access to a Subject's private credential set requires the caller to have been granted a PrivateCredentialPermission for the corresponding credential class.

理解Subjects, Principals and Credentials相关推荐

  1. 学习资料2900篇(4~6)

    1451 round 方法  1452 RSS 2.0 Specification  1453 Ruby入门之代码块.迭代子和过程对象  1454 SAS9新体验:在DATA STEP中使用JAVA对 ...

  2. Shiro 权限框架使用总结

    我们首先了解下什么是shiro ,Shiro 是 JAVA 世界中新近出现的权限框架,较之 JAAS 和 Spring Security,Shiro 在保持强大功能的同时,还在简单性和灵活性方面拥有巨 ...

  3. 将 Shiro 作为应用的权限基础

    Shiro 是 Java 世界中新近出现的权限框架,较之 JAAS 和 Spring Security,Shiro 在保持强大功能的同时,还在简单性和灵活性方面拥有巨大优势.本文介绍了 Shiro 的 ...

  4. Apache shiro介绍

    原文链接Application Security With Apache Shiro(翻译) 前面自己自己配合谷歌翻译,后面大部分谷歌翻译. 当你尝试保护你的程序时候你会被困扰吗?你会觉得现有的jav ...

  5. java安全 ——JAAS(Java 认证和授权服务)开发指南

    以下内容转自: http://lyb520320.iteye.com/blog/720478 [0]README 1)本文翻译自:http://java.sun.com/developer/techn ...

  6. 10分钟教会你Apache Shiro

    前言 欢迎来到Apache Shiro 10分钟之旅! 希望通过这个简单.快速的示例,可以让你对应用程序中使用Shiro有个深入的了解.嗯,10分钟你应该可以搞定它. 概述 Apache Shiro是 ...

  7. shiro将session认证改成token认证_初步学习Shiro框架 第一集

    1.什么是Shiro Apache Shiro™ is a powerful and easy-to-use Java security framework that performs authent ...

  8. Shiro的简单入门(一)

    一.shiro的简介 Apache Shiro(发音为"shee-roh",日语"堡垒(Castle)"的意思)是一个强大易用的Java安全框架,提供了认证.授 ...

  9. JavaEE知识体系

    1 1.文件上传下载 1.1 文件上传 1.1.1 文件上传的作用 例如网络硬盘!就是用来上传下载文件的. 在智联招聘上填写一个完整的简历还需要上传照片呢. 1.1.2 文件上传对页面的要求 1.必须 ...

最新文章

  1. R语言基于glmnet构建Logistic回归模型使用L1正则化并可视化系数及最佳lambda值
  2. 分类家族:二分类、多分类、多标签分类、多输出分类
  3. ASP.NET 学习笔记_01 广告控件的使用
  4. Java-Java I/O流解读之基于字符的I / O和字符流
  5. 8 张图,看你是否理解 Java
  6. cmos门电路输入端悬空相当于_TTL和CMOS,CMOS电平和TTL电平区别
  7. 进入Linux单用户模式
  8. C#隐藏桌面图标和任务栏
  9. 重置手机_【轻松办税】ITS客户端申报密码重置不会操作?看过来,3分钟包你会!...
  10. ApkTool2.34 打包经验
  11. centos+darwin搭建简单的视频流服务器
  12. 首席翻译的英语学习方法
  13. 新一配:为什么现在都找不到破解软件了?
  14. 机器学习十大算法(一)
  15. excel 删除大量空白行
  16. [附源码]Python计算机毕业设计SSM基于Yigo平台库房管理系统(程序+LW)
  17. 解读大内老A的《.NET Core框架本质》
  18. 一只兔子每三个月生兔子JAVA,兔子生兔子问题
  19. 误差向量幅度(EVM)
  20. LINUX下,C语言MALLOC可能达到的最大空间测试

热门文章

  1. 一段有趣的python代码_你知道 Python 这五个有趣的彩蛋吗?
  2. 逆战 (正则)用户名验证
  3. 杂谈java面向对象
  4. android下拉列表添加开关,下拉菜单界面增加了Nearby开关
  5. PrintWriter实现追加文本底层探究
  6. html涟漪特效,基于WebGL的炫酷元素背景水波涟漪jQuery特效
  7. 【像素艺术】-【Java】【一键像素|马赛克】
  8. 计算机二级证书含金量有多高?你真的知道吗?
  9. sharepoint infopath
  10. 2011,Ready!