|
JavaTM 2 Platform Standard Ed. 5.0 |
|||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||
java.lang.Objectjava.security.Identity
java.security.IdentityScope
java.security.KeyStore、java.security.cert 包和 java.security.Principal 取代。
@Deprecated public abstract class IdentityScope
此类表示身份的作用域。它本身也是 Identity,因此有名称和作用域。它也可以选择有一个公钥和关联的证书。
IdentityScope 可以包括各种类型的 Identity 对象,包括 Signer。所有类型的 Identity 对象都可以使用相同的方法检索、添加和删除。注意,对于在各种类型的 Identity 上的各种操作,不同类型的身份作用域将应用不同的策略,这是可能的,实际上也期望如此。
密钥和身份是一对一的映射关系,在每个作用域内一个密钥只能有一个副本。例如,假定 Acme Software, Inc 是用户已知的软件发行人。假定它是一个 Identity,也就是说,它有公钥和关联的证书集合。它在某个作用域内使用名称 "Acme Software" 命名。该作用域内没有其他命名的 Identity 具有相同的公钥。当然,也没有相同的名称。
| 构造方法摘要 | |
|---|---|
protected |
IdentityScope()
已过时。 此构造方法只用于序列化,不能被子类使用。 |
|
IdentityScope(String name)
已过时。 构造具有指定名称的新身份作用域。 |
|
IdentityScope(String name,
IdentityScope scope)
已过时。 构造具有指定名称和作用域的新身份作用域。 |
| 方法摘要 | |
|---|---|
abstract void |
addIdentity(Identity identity)
已过时。 向此身份作用域添加一个身份。 |
Identity |
getIdentity(Principal principal)
已过时。 检索名称与指定的主体相同的身份。 |
abstract Identity |
getIdentity(PublicKey key)
已过时。 检索具有指定公钥的身份。 |
abstract Identity |
getIdentity(String name)
已过时。 返回此作用域内具有指定名称的身份(如果有的话)。 |
static IdentityScope |
getSystemScope()
已过时。 返回系统的身份作用域。 |
abstract Enumeration<Identity> |
identities()
已过时。 返回此身份作用域内所有身份的枚举。 |
abstract void |
removeIdentity(Identity identity)
已过时。 从此身份作用作用域移除一个身份。 |
protected static void |
setSystemScope(IdentityScope scope)
已过时。 设置系统的身份作用域。 |
abstract int |
size()
已过时。 返回此身份作用域内身份的数目。 |
String |
toString()
已过时。 返回此身份作用域的字符串表示形式,包括其名称、作用域名称和此身份作用域中身份的数目。 |
| 从类 java.security.Identity 继承的方法 |
|---|
addCertificate, certificates, equals, getInfo, getName, getPublicKey, getScope, hashCode, identityEquals, removeCertificate, setInfo, setPublicKey, toString |
| 从类 java.lang.Object 继承的方法 |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| 构造方法详细信息 |
|---|
protected IdentityScope()
public IdentityScope(String name)
name - 作用域名称。public IdentityScope(String name, IdentityScope scope) throws KeyManagementException
name - 作用域名称。scope - 新身份作用域的作用域。
KeyManagementException - 在此作用域内已经存在一个具有相同名称的 Identity。| 方法详细信息 |
|---|
public static IdentityScope getSystemScope()
setSystemScope(java.security.IdentityScope)protected static void setSystemScope(IdentityScope scope)
首先,如果存在安全管理器,则用 "setSystemScope" 作为参数调用其 checkSecurityAccess 方法,以查看它是否可以设置身份作用域。
scope - 要设置的作用域。
SecurityException - 如果安全管理器存在并且其 checkSecurityAccess 方法不允许设置身份作用域。getSystemScope(),
SecurityManager.checkSecurityAccess(java.lang.String)public abstract int size()
public abstract Identity getIdentity(String name)
name - 要检索的身份的名称。
name 的身份,如果在此作用域内没有名称为 name 的身份,则返回 null。public Identity getIdentity(Principal principal)
principal - 相应于要检索的身份的主体。
public abstract Identity getIdentity(PublicKey key)
key - 要返回的身份的公钥。
public abstract void addIdentity(Identity identity) throws KeyManagementException
identity - 要添加的身份。
KeyManagementException - 如果身份是无效的、出现了名称冲突、另一个身份与要添加的身份有相同的公钥,或者出现其他异常public abstract void removeIdentity(Identity identity) throws KeyManagementException
identity - 要移除的身份。
KeyManagementException - 如果身份丢失或出现其他的异常。public abstract Enumeration<Identity> identities()
public String toString()
SecurityManager.checkSecurityAccess(java.lang.String)
|
JavaTM 2 Platform Standard Ed. 5.0 |
|||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||
版权所有 2004 Sun Microsystems, Inc. 保留所有权利。 请遵守许可证条款。另请参阅文档重新分发政策。