GenericCredential (Java EE 5)

Java EE API


javax.resource.spi.security Interface GenericCredential


Deprecated. The preferred way to represent generic credential information is via the org.ietf.jgss.GSSCredential interface in J2SE Version 1.4, which provides similar functionality.


接口 javax.resource.spi.security.GenericCredential 定义与安全机制无关的接口,用于访问资源主体的安全凭据。

GenericCredential 接口提供一个 Java 包装器,用于包装安全凭据特定于底层机制的表示形式。例如,可以使用 GenericCredential 接口包装 Kerberos 凭据。

连接器架构不为特定于安全机制的凭据定义任何标准格式和要求。例如,GenericCredential 接口包装的安全凭据可以具有特定于操作系统的本机表示形式。

GenericCredential 接口使资源适配器能够提取有关安全凭据的信息。然后,资源适配器就可以通过以下方法管理资源主体的 EIS 登录:

  • 如果底层 EIS 支持 GenericCredential 实例表示的安全机制类型,则使用特定于 EIS 的方式使用凭据,或者
  • 如果资源适配器和底层 EIS 实例支持 GSS-API,则使用 GSS-API。
英文文档:

public interface GenericCredential

The interface javax.resource.spi.security.GenericCredential defines a security mechanism independent interface for accessing security credential of a resource principal.

The GenericCredential interface provides a Java wrapper over an underlying mechanism specific representation of a security credential. For example, the GenericCredential interface can be used to wrap Kerberos credentials.

The connector architecture does not define any standard format and requirements for security mechanism specific credentials. For example, a security credential wrapped by a GenericCredential interface can have a native representation specific to an operating system.

The GenericCredential interface enables a resource adapter to extract information about a security credential. The resource adapter can then manage EIS sign-on for a resource principal by either:

  • using the credentials in an EIS specific manner if the underlying EIS supports the security mechanism type represented by the GenericCredential instance, or,
  • using GSS-API if the resource adapter and underlying EIS instance support GSS-API.

Since:
0.7
Version:
0.7
Author:
Rahul Sharma
See Also:
Subject, Principal

Method Summary
 boolean
 byte[]
 String
 String
 int
 

Method Detail

public String getName()
返回与 GenericCredential 实例关联的资源主体的名称。
return 主体的名称
英文文档:

getName

String getName()
Deprecated. 
Returns the name of the resource principal associated with a GenericCredential instance.

Returns:
Name of the principal

public String getMechType()
返回 GenericCredential 实例的机制类型。GenericCredential 的机制类型定义应该与基于 GSS 规范所指定表示形式的对象标识符 (OID) 保持一致。在 GenericCredential 接口中,以 OID 规范的字符串化表示形式返回机制类型。
return 机制类型
英文文档:

getMechType

String getMechType()
Deprecated. 
Returns the mechanism type for the GenericCredential instance. The mechanism type definition for GenericCredential should be consistent with the Object Identifier (OID) based representation specified in the GSS specification. In the GenericCredential interface, the mechanism type is returned as a stringified representation of the OID specification.

Returns:
mechanism type

public byte[] getCredentialData() throws SecurityException
获取 GenericCredential 表示的特定安全机制的安全数据。例如验证数据,代表关联的资源主体建立与 EIS 实例的安全关联时需要该数据。

getCredentialData 方法以 byte 数组的形式返回凭据表示形式。注意,连接器架构不为返回的凭据数据定义任何标准格式。

return byte 数组形式的凭据表示形式。
ThrowsSecurityException: 由于与安全有关的错误情况导致操作失败

英文文档:

getCredentialData

byte[] getCredentialData()
                         throws SecurityException
Deprecated. 
Gets security data for a specific security mechanism represented by the GenericCredential. An example is authentication data required for establishing a secure association with an EIS instance on behalf of the associated resource principal.

The getCredentialData method returns the credential representation as an array of bytes. Note that the connector architecture does not define any standard format for the returned credential data.

Returns:
credential representation as an array of bytes.
Throws:
SecurityException - Failed operation due to security related error condition

public boolean equals(Object another)
测试此 GenericCredential 实例是否引用了与提供的对象相同的实体。这两个凭据必须通过相同的机制获取,并且必须引用相同的主体。 如果两个 GenericCredential 都引用了同一实体,则返回 true;否则返回 false。
英文文档:

equals

boolean equals(Object another)
Deprecated. 
Tests if this GenericCredential instance refers to the same entity as the supplied object. The two credentials must be acquired over the same mechanisms and must refer to the same principal. Returns true if the two GenericCredentials refer to the same entity; false otherwise.

Overrides:
equals in class Object

public int hashCode()
返回此 GenericCredential 的哈希码
return 此 GenericCredential 的哈希码
英文文档:

hashCode

int hashCode()
Deprecated. 
Returns the hash code for this GenericCredential

Overrides:
hashCode in class Object
Returns:
hash code for this GenericCredential


Submit a bug or feature

Copyright 2007 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.

一看就知道只有菜鸟才干这么无知的事啦。

PS : 未经我党受权你也可自由散发此文档。 如有任何错误请自行修正;若因此而造成任何损失请直接找人民主席,请勿与本人联系。谢谢!