专业术语
1. Subject(主体)
package javax.security.auth;
/**
* 1. Subject represents a grouping of related information for a single entity.
* 2. information includes the Subject's identities as well as its security-related attributes.
* 2.1 security-related attributes: cryptographic key(密钥), password.
* 2.2 Subject's identities: Subject may have multiple identities, Each identity is represented as a Principal within the Subject, Principals simply bind names to a Subject.
* /
public final class Subject implements java.io.Serializable {
/**
* provides a view of all of this Subject's Principals
* Each element in this set is a
* {@code java.security.Principal}.
*/
Set<Principal> principals;
/**
* Sets that provide a view of all of this
* Subject's Credentials(凭证,认证信息,证书...)
*/
transient Set<Object> pubCredentials;
transient Set<Object> privCredentials;
}
a Subject that happens to be a person, Alice, might have two Principals:
- one which binds “Alice Bar”, the name on her driver license to the Subject.
- and another which binds “999-99-9999”, the number on her student identification card to the Subject.
Both Principals refer to the same Subject even though each has a different name.
2. Principal(本体)
package java.security;
/**
* This interface represents the abstract notion of a principal, which
* can be used to represent any entity, such as an individual(个体), a
* corporation(团体), and a login id.
*
* @see java.security.cert.X509Certificate
*
* @author Li Gong
* @since 1.1
*/
public interface Principal {
/**
* @return the name of this principal.
*/
public String getName();
}
Java security 哲学 (主体-本体-实体)
- Subject(主体)由多个实体(entity)组成
- 每个个体有各自关联的身份标识(identity)以及认证信息(credentials)
- 每一个身份标识(identity)在Subject里又被称为Principal(本体)
3. 其他
- 认证(Authentication)和授权(Authorization) : 怎么记? (author作者)出版书要作者授权(Authorization)
- credentials(认证信息,凭证): 用户持有的,一般情况下只有这个用户知道的数据,用户能够使用这个数据来证明他的身份。
- 哲学体系里主体/本体/实体区别与联系
- 主体相对于客体而言,客体指“我”之外的一切事物,是认识与实践的对象;主体则是认识与实践者,即“我”。
- 本体相对于现象而言,是事物之所以为此事物的内在根据。
- 实体是客观的物质世界,指有形、有象之物。