| 
 | JavaTM Platform Standard Ed. 6 | |||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||
java.lang.Objectjavax.security.auth.kerberos.KerberosKey
public class KerberosKey
     此类为 Kerberos 主体封装一个长期秘密密钥。
 获取主体的密码和从主体生成秘密密钥的所有 Kerberos JAAS 登录模块都应该使用此类。在任何可以使用的地方,登录模块甚至可以直接从 Kerberos "keytab" 读取此秘密密钥。有时,例如在没有用户到用户 (user-to-user) 验证的情况下对服务器进行验证时,在验证过程的提交阶段,登录模块将在 Subject 的私有证书集中存储此类的实例。
 如果应用程序需要从 Subject 访问 KerberosKey 实例,可能必须授予应用程序 PrivateCredentialPermission 权限。当应用程序依靠默认的 JGSS Kerberos 机制去访问 KerberosKey 时,不需要此权限。但在这种情况下,应用程序将需要适当的 ServicePermission 权限。 
| 构造方法摘要 | |
|---|---|
| KerberosKey(KerberosPrincipal principal, byte[] keyBytes, int keyType, int versionNum)当已知密钥类型和密钥版本号时,根据给出的字节构造 KerberosKey。 | |
| KerberosKey(KerberosPrincipal principal, char[] password, String algorithm)根据主体的密码构造 KerberosKey。 | |
| 方法摘要 | |
|---|---|
|  void | destroy()销毁此密钥。 | 
|  boolean | equals(Object other)比较指定 Object 与此 KerberosKey 的相等性。 | 
|  String | getAlgorithm()返回此密钥的标准算法名称。 | 
|  byte[] | getEncoded()返回秘密密钥的密钥材料。 | 
|  String | getFormat()返回此秘密密钥的编码格式的名称。 | 
|  int | getKeyType()返回此长期密钥的密钥类型。 | 
|  KerberosPrincipal | getPrincipal()返回此密钥所属的主体。 | 
|  int | getVersionNumber()返回密钥版本号。 | 
|  int | hashCode()返回此 KerberosKey 的哈希码。 | 
|  boolean | isDestroyed()确定此密钥是否已经销毁。 | 
|  String | toString()返回该对象的字符串表示。 | 
| 从类 java.lang.Object 继承的方法 | 
|---|
| clone, finalize, getClass, notify, notifyAll, wait, wait, wait | 
| 构造方法详细信息 | 
|---|
public KerberosKey(KerberosPrincipal principal,
                   byte[] keyBytes,
                   int keyType,
                   int versionNum) 
  
principal - 此秘密密钥所属的主体
     keyBytes - 秘密密钥的原始字节
     keyType - 秘密密钥的密钥类型,由 Kerberos 协议规范定义。
     versionNum - 此秘密密钥的版本号。
     
public KerberosKey(KerberosPrincipal principal,
                   char[] password,
                   String algorithm) 
  
principal - 此密码所属的主体
     password - 应该用于计算密钥的密码
     algorithm - 此密钥将使用的算法的名称。在假定默认算法为 "DES" 的情况下此参数可以为 null。 
     IllegalArgumentException - 如果不支持传递的算法名称。
     | 方法详细信息 | 
|---|
public final KerberosPrincipal getPrincipal()
public final int getVersionNumber()
public final int getKeyType()
public final String getAlgorithm()
Key 中的 
      getAlgorithm
     public final String getFormat()
Key 中的 
      getFormat
     public final byte[] getEncoded()
Key 中的 
      getEncoded
     
public void destroy()
             throws DestroyFailedException 
  
Destroyable 中的 
      destroy
     DestroyFailedException - 如果销毁密钥时出现一些错误。
     public boolean isDestroyed()
Destroyable 中的 
      isDestroyed
     Object 已经销毁,则返回 true;否则,返回 false。
     public String toString()
Object 复制的描述
   toString 方法会返回一个“以文本方式表示”此对象的字符串。结果应是一个简明但易于读懂的信息表达式。建议所有子类都重写此方法。 
     Object 类的 toString 方法返回一个字符串,该字符串由类名(对象是该类的一个实例)、at 标记符“@”和此对象哈希码的无符号十六进制表示组成。换句话说,该方法返回一个字符串,它的值等于: 
getClass().getName() + '@' + Integer.toHexString(hashCode())
Object 中的 
      toString
     public int hashCode()
Object 中的 
      hashCode
     KerberosKey 的 hashCode()
     Object.equals(java.lang.Object), 
      Hashtable
     public boolean equals(Object other)
KerberosKey 并且两个 
    KerberosKey 实例相等,则返回 true。 
    
Object 中的 
      equals
     other - 要与之比较的引用对象。 
     true;否则返回 
      false。
     Object.hashCode(), 
      Hashtable
     | 
 | JavaTM Platform Standard Ed. 6 | |||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||
版权所有 2007 Sun Microsystems, Inc. 保留所有权利。 请遵守许可证条款。另请参阅文档重新分发政策。