Project JXTA

net.jxta.credential
Interface Credential

All Known Subinterfaces:
PrivilegedOperation, PrivledgedOperation
All Known Implementing Classes:
AuthenticationCredential

public interface Credential

Credentials provide the basic mechanisms for securly establishing and communicating identity within JXTA. Credentials have three different roles within JXTA:

The XML representation of a Credential uses the following very simple schema. Credential implementations extend this schema as needed.

 <xs:complexType name="Cred">
   <xs:all>
   </xs:all>
 </xs:complexType>
 


Method Summary
 StructuredDocument getDocument(MimeMediaType asMimeType)
          Write credential into a document.
 ID getPeerGroupID()
          Returns the peerGroupID associated with this credential
 ID getPeerID()
          Returns the peerID associated with this credential
 Service getSourceService()
          Returns the service which generated this credential.
 Object getSubject()
          Returns the subject of this credential.
 boolean isExpired()
          If true then the credential is expired.
 boolean isValid()
          Returns true if this credential is currently valid.
 

Method Detail

getPeerGroupID

ID getPeerGroupID()
Returns the peerGroupID associated with this credential

Returns:
the peerGroupID associated with this credential

getPeerID

ID getPeerID()
Returns the peerID associated with this credential

Returns:
the peerID associated with this credential

getSourceService

Service getSourceService()
Returns the service which generated this credential.

Returns:
the service which generated this credential.

isExpired

boolean isExpired()
If true then the credential is expired. Some credential implementations may never epxire.


isValid

boolean isValid()
Returns true if this credential is currently valid.

Returns:
boolean true if the credential is currently valid, otherwise false.

getSubject

Object getSubject()
Returns the subject of this credential. The Objects returned must support Object.equals(Object) and Object.hashCode().

Returns:
the subject of the credential as an abstract object.

getDocument

StructuredDocument getDocument(MimeMediaType asMimeType)
                               throws Exception
Write credential into a document. asMimeType is a mime media-type specification and provides the form of the document which is being requested. Two standard document forms are defined. "text/plain" encodes the document in a "pretty-print" format for human viewing and "text/xml" which provides an XML format.

Depending on the credential format this document may be cryptographically signed to prevent alteration.

Parameters:
asMimeType - MimeMediaType format representation requested
Returns:
Document the document to be used in the construction
Throws:
Exception

JXTA J2SE