- java.lang.Object
-  
      - java.security.Identity
-  
        - java.security.IdentityScope
 
 
-  
       - 实现的所有接口
-  
         Serializable,Principal
 
 @Deprecated(since="1.2", forRemoval=true) public abstract class IdentityScope extends Identity Deprecated, for removal: This API element is subject to removal in a future version.This class is deprecated and subject to removal in a future version of Java SE. It has been replaced byjava.security.KeyStore, thejava.security.certpackage, andjava.security.Principal.此类表示身份的范围。 它本身就是一个身份,因此有一个名称,可以有一个范围。 它还可以选择具有公钥和相关证书。 IdentityScope可以包含各种标识对象,包括签名者。 可以使用相同的方法检索,添加和删除所有类型的Identity对象。 请注意,可能并且实际上预期不同类型的标识范围将针对各种类型的标识对其各种操作应用不同的策略。 密钥和身份之间存在一对一的映射,每个范围只能有一个密钥的一个副本。 例如,假设Acme Software,Inc是用户已知的软件发布者。 假设它是一个Identity,即它有一个公钥和一组相关的证书。 它在范围内使用名称“Acme Software”命名。 范围中没有其他命名的标识具有相同的公钥。 当然,没有一个同名。 - 从以下版本开始:
- 1.1
- 另请参见:
-  
         Identity,Signer,Principal,Key, Serialized Form
 
-  
        
       -  
             构造方法摘要构造方法 变量 构造器 描述 protectedIdentityScope()不推荐使用,要删除:此API元素将在以后的版本中删除。此构造函数仅用于序列化,不应由子类使用。IdentityScope(String name)不推荐使用,要删除:此API元素将在以后的版本中删除。构造具有指定名称的新标识范围。IdentityScope(String name, IdentityScope scope)不推荐使用,要删除:此API元素将在以后的版本中删除。构造具有指定名称和范围的新标识范围。
 -  
             方法摘要所有方法 静态方法 实例方法 抽象方法 具体的方法 弃用的方法 变量和类型 方法 描述 abstract voidaddIdentity(Identity identity)不推荐使用,要删除:此API元素将在以后的版本中删除。向此标识范围添加标识。abstract IdentitygetIdentity(String name)不推荐使用,要删除:此API元素将在以后的版本中删除。返回此范围内具有指定名称(如果有)的标识。IdentitygetIdentity(Principal principal)不推荐使用,要删除:此API元素将在以后的版本中删除。检索其名称与指定主体的名称相同的标识。abstract IdentitygetIdentity(PublicKey key)不推荐使用,要删除:此API元素将在以后的版本中删除。使用指定的公钥检索标识。static IdentityScopegetSystemScope()不推荐使用,要删除:此API元素将在以后的版本中删除。返回系统的标识范围。abstract Enumeration<Identity>identities()不推荐使用,要删除:此API元素将在以后的版本中删除。返回此标识范围中所有标识的枚举。abstract voidremoveIdentity(Identity identity)不推荐使用,要删除:此API元素将在以后的版本中删除。从此标识范围中删除标识。protected static voidsetSystemScope(IdentityScope scope)不推荐使用,要删除:此API元素将在以后的版本中删除。设置系统的标识范围。abstract intsize()不推荐使用,要删除:此API元素将在以后的版本中删除。返回此标识范围内的标识数。StringtoString()不推荐使用,要删除:此API元素将在以后的版本中删除。返回此标识范围的字符串表示形式,包括其名称,范围名称以及此标识范围中的标识数。-  
               声明方法的类 java.security.IdentityaddCertificate, certificates, equals, getInfo, getName, getPublicKey, getScope, hashCode, identityEquals, removeCertificate, setInfo, setPublicKey, toString
 
-  
               
 
-  
             
-  
        
       -  
             构造方法详细信息-  IdentityScopeprotected IdentityScope() Deprecated, for removal: This API element is subject to removal in a future version.此构造函数仅用于序列化,不应由子类使用。
 -  IdentityScopepublic IdentityScope(String name) Deprecated, for removal: This API element is subject to removal in a future version.构造具有指定名称的新标识范围。- 参数
-  
              name- 范围名称。
 
 -  IdentityScopepublic IdentityScope(String name, IdentityScope scope) throws KeyManagementException Deprecated, for removal: This API element is subject to removal in a future version.构造具有指定名称和范围的新标识范围。- 参数
-  
              name- 范围名称。
-  
              scope- 新标识范围的范围。
- 异常
-  
              KeyManagementException- 如果范围中已存在具有相同名称的标识。
 
 
-  
 -  
             方法详细信息-  getSystemScopepublic static IdentityScope getSystemScope() Deprecated, for removal: This API element is subject to removal in a future version.返回系统的标识范围。- 结果
- 
               系统的标识范围,如果没有设置, 
              null。
- 另请参见:
-  
              setSystemScope(java.security.IdentityScope)
 
 -  setSystemScopeprotected static void setSystemScope(IdentityScope scope) Deprecated, for removal: This API element is subject to removal in a future version.设置系统的标识范围。首先,如果有一个安全管理器,则调用其 checkSecurityAccess方法,并以"setSystemScope"作为其参数,以查看是否可以设置标识范围。- 参数
-  
              scope- 要设置的范围。
- 异常
-  
              SecurityException- 如果存在安全管理器且其checkSecurityAccess方法不允许设置标识范围。
- 另请参见:
-  
              getSystemScope(),SecurityManager.checkSecurityAccess(java.lang.String)
 
 -  sizepublic abstract int size() Deprecated, for removal: This API element is subject to removal in a future version.返回此标识范围内的标识数。- 结果
- 此身份范围内的身份数量。
 
 -  getIdentitypublic abstract Identity getIdentity(String name) Deprecated, for removal: This API element is subject to removal in a future version.返回此范围内具有指定名称(如果有)的标识。- 参数
-  
              name- 要检索的标识的名称。
- 结果
- 
               标识为 
              name的标识,如果此范围内没有名为name的标识,namenull。
 
 -  getIdentitypublic Identity getIdentity(Principal principal) Deprecated, for removal: This API element is subject to removal in a future version.检索其名称与指定主体的名称相同的标识。 (注意:Identity实现了Principal。)- 参数
-  
              principal- 与要检索的标识对应的主体。
- 结果
- 其名称与主体名称相同的标识,如果此范围内没有同名标识,则为null。
 
 -  getIdentitypublic abstract Identity getIdentity(PublicKey key) Deprecated, for removal: This API element is subject to removal in a future version.使用指定的公钥检索标识。- 参数
-  
              key- 要返回的标识的公钥。
- 结果
- 具有给定键的标识,如果此范围内没有该标识的标识,则返回null。
 
 -  addIdentitypublic abstract void addIdentity(Identity identity) throws KeyManagementException Deprecated, for removal: This API element is subject to removal in a future version.向此标识范围添加标识。- 参数
-  
              identity- 要添加的标识。
- 异常
-  
              KeyManagementException- 如果标识无效,则发生名称冲突,另一个标识与添加的标识具有相同的公钥,或发生另一个异常。
 
 -  removeIdentitypublic abstract void removeIdentity(Identity identity) throws KeyManagementException Deprecated, for removal: This API element is subject to removal in a future version.从此标识范围中删除标识。- 参数
-  
              identity- 要删除的标识。
- 异常
-  
              KeyManagementException- 如果缺少标识,或发生另一个异常。
 
 -  identitiespublic abstract Enumeration<Identity> identities() Deprecated, for removal: This API element is subject to removal in a future version.返回此标识范围中所有标识的枚举。- 结果
- 此身份范围内所有身份的枚举。
 
 -  toStringpublic String toString() Deprecated, for removal: This API element is subject to removal in a future version.返回此标识范围的字符串表示形式,包括其名称,范围名称以及此标识范围中的标识数。- Specified by:
-  
              toString,界面Principal
- 重写:
-  
              toStringin classIdentity
- 结果
- 此标识范围的字符串表示形式。
- 另请参见:
-  
              SecurityManager.checkSecurityAccess(java.lang.String)
 
 
-  
 
-