认证与授权#0#专业术语

专业术语

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:

  1. one which binds “Alice Bar”, the name on her driver license to the Subject.
  2. 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 哲学 (主体-本体-实体)

  1. Subject(主体)由多个实体(entity)组成
  2. 每个个体有各自关联的身份标识(identity)以及认证信息(credentials)
  3. 每一个身份标识(identity)在Subject里又被称为Principal(本体)
3. 其他
  • 认证(Authentication)和授权(Authorization) : 怎么记? (author作者)出版书要作者授权(Authorization)
  • credentials(认证信息,凭证): 用户持有的,一般情况下只有这个用户知道的数据,用户能够使用这个数据来证明他的身份。
  • 哲学体系里主体/本体/实体区别与联系
    • 主体相对于客体而言,客体指“我”之外的一切事物,是认识与实践的对象;主体则是认识与实践者,即“我”。
    • 本体相对于现象而言,是事物之所以为此事物的内在根据。
    • 实体是客观的物质世界,指有形、有象之物。
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

许心月

码字不易,感谢支持。

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值