org.eclipse.higgins.icard.provider.cardspace.common
Class PersonalCard

java.lang.Object
  extended byorg.eclipse.higgins.icard.common.Card
      extended byorg.eclipse.higgins.icard.provider.cardspace.common.InformationCard
          extended byorg.eclipse.higgins.icard.provider.cardspace.common.PersonalCard
All Implemented Interfaces:
org.eclipse.higgins.icard.ICard, org.eclipse.higgins.icard.IClaimContainer, org.eclipse.higgins.icard.IClaimTypeContainer, org.eclipse.higgins.icard.IInformationCard, org.eclipse.higgins.icard.IPersonalInformationCard
Direct Known Subclasses:
DummyPersonalCard

public abstract class PersonalCard
extends InformationCard
implements org.eclipse.higgins.icard.IPersonalInformationCard


Field Summary
static String ISSUER_SELF
           
static int LOCKED
           
static int NO_PIN
           
static int UNLOCKED
           
 
Constructor Summary
PersonalCard()
           
 
Method Summary
 Element claimsToXML(Document doc)
           
 org.eclipse.higgins.icard.IClaim getClaim(String type)
           
 org.eclipse.higgins.icard.IClaim getClaimByLocalName(String shortTypeName)
           
 URI getClaimListContextID()
           
 String getClaimListEntityID()
           
 Iterator getClaims()
           
 byte[] getPinDigest()
           
 int getPinStatus()
           
 org.eclipse.higgins.icard.auth.ICredentialDescriptor[] getRequiredCredentials()
           
 String getType()
           
 void initFromXML(Element card)
           
abstract  void lock(org.eclipse.higgins.icard.auth.IPinCodeCredential credential)
          If the card is not locked, this method protect the card by PIN code.
 org.eclipse.higgins.icard.io.IElement toElement(org.eclipse.higgins.icard.io.IElementFormat format)
           
abstract  void unlock(org.eclipse.higgins.icard.auth.IPinCodeCredential credential)
          If the card is locked by PIN code, this method unlock the claim values and the master key.
abstract  boolean validatePINCode(String pinCode)
          Validate a user input pin code
 
Methods inherited from class org.eclipse.higgins.icard.provider.cardspace.common.InformationCard
getHashSalt, getIssuerID, getMasterKey
 
Methods inherited from class org.eclipse.higgins.icard.common.Card
getCUID, getDescription, getID, getImage, getImageType, getIssuer, getIssuerName, getName, getProvider, getSupportedClaimTypes, getSupportedClaimTypesUris, getSupportedTokenTypes, getTimeExpires, getTimeIssued, getTimeLastUpdated, getVersion, isClaimsRetrieved, isFormatSupported, isSelfIssued, setClaims
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.eclipse.higgins.icard.IPersonalInformationCard
setPinCode
 
Methods inherited from interface org.eclipse.higgins.icard.IInformationCard
getHashSalt, getIssuerID, getMasterKey
 
Methods inherited from interface org.eclipse.higgins.icard.ICard
applyUpdates, beginUpdates, cancelUpdates, getCUID, getDescription, getID, getImage, getImageType, getIssuer, getIssuerName, getName, getProvider, getSupportedClaimTypesUris, getSupportedTokenTypes, getTimeExpires, getTimeIssued, getTimeLastUpdated, getVersion, isClaimsRetrieved, isEditable, isEditMode, isFormatSupported, isSelfIssued, setImage, setIssuerName, setName, setTimeExpires
 
Methods inherited from interface org.eclipse.higgins.icard.IClaimTypeContainer
getSupportedClaimTypes
 
Methods inherited from interface org.eclipse.higgins.icard.IClaimContainer
createClaim, setClaim
 

Field Detail

ISSUER_SELF

public static String ISSUER_SELF

NO_PIN

public static final int NO_PIN
See Also:
Constant Field Values

LOCKED

public static final int LOCKED
See Also:
Constant Field Values

UNLOCKED

public static final int UNLOCKED
See Also:
Constant Field Values
Constructor Detail

PersonalCard

public PersonalCard()
Method Detail

initFromXML

public void initFromXML(Element card)
                 throws org.eclipse.higgins.icard.CardException,
                        DOMException
Parameters:
card -
Throws:
org.eclipse.higgins.icard.CardException
DOMException

getClaimListContextID

public URI getClaimListContextID()
Specified by:
getClaimListContextID in interface org.eclipse.higgins.icard.IPersonalInformationCard
Throws:
org.eclipse.higgins.icard.CardException

getClaimListEntityID

public String getClaimListEntityID()
Specified by:
getClaimListEntityID in interface org.eclipse.higgins.icard.IPersonalInformationCard

toElement

public org.eclipse.higgins.icard.io.IElement toElement(org.eclipse.higgins.icard.io.IElementFormat format)
                                                throws org.eclipse.higgins.icard.CardException,
                                                       org.eclipse.higgins.icard.io.CardIOException,
                                                       org.eclipse.higgins.icard.io.UnsupportedElementFormatException
Specified by:
toElement in interface org.eclipse.higgins.icard.ICard
Throws:
org.eclipse.higgins.icard.CardException
org.eclipse.higgins.icard.io.CardIOException
org.eclipse.higgins.icard.io.UnsupportedElementFormatException

claimsToXML

public Element claimsToXML(Document doc)
                    throws org.eclipse.higgins.icard.CardException
Parameters:
doc -
Returns:
Throws:
org.eclipse.higgins.icard.CardException

getPinDigest

public byte[] getPinDigest()
                    throws org.eclipse.higgins.icard.CardException
Specified by:
getPinDigest in interface org.eclipse.higgins.icard.IPersonalInformationCard
Throws:
org.eclipse.higgins.icard.CardException

getClaim

public org.eclipse.higgins.icard.IClaim getClaim(String type)
                                          throws org.eclipse.higgins.icard.AuthenticationRequiredException,
                                                 org.eclipse.higgins.icard.InvalidTypeException,
                                                 org.eclipse.higgins.icard.CardException
Specified by:
getClaim in interface org.eclipse.higgins.icard.IClaimContainer
Throws:
org.eclipse.higgins.icard.AuthenticationRequiredException
org.eclipse.higgins.icard.InvalidTypeException
org.eclipse.higgins.icard.CardException

getClaimByLocalName

public org.eclipse.higgins.icard.IClaim getClaimByLocalName(String shortTypeName)
                                                     throws org.eclipse.higgins.icard.AuthenticationRequiredException,
                                                            org.eclipse.higgins.icard.InvalidTypeException,
                                                            org.eclipse.higgins.icard.CardException
Specified by:
getClaimByLocalName in interface org.eclipse.higgins.icard.ICard
Throws:
org.eclipse.higgins.icard.AuthenticationRequiredException
org.eclipse.higgins.icard.InvalidTypeException
org.eclipse.higgins.icard.CardException

getClaims

public Iterator getClaims()
                   throws org.eclipse.higgins.icard.CardException
Specified by:
getClaims in interface org.eclipse.higgins.icard.IClaimContainer
Throws:
org.eclipse.higgins.icard.CardException

getRequiredCredentials

public org.eclipse.higgins.icard.auth.ICredentialDescriptor[] getRequiredCredentials()
Specified by:
getRequiredCredentials in interface org.eclipse.higgins.icard.ICard

getPinStatus

public int getPinStatus()

validatePINCode

public abstract boolean validatePINCode(String pinCode)
                                 throws Exception
Validate a user input pin code

Parameters:
pinCode -
Returns:
Throws:
UnsupportedEncodingException
NoSuchAlgorithmException
Exception

lock

public abstract void lock(org.eclipse.higgins.icard.auth.IPinCodeCredential credential)
                   throws Exception
If the card is not locked, this method protect the card by PIN code.

Parameters:
credential -
Throws:
Exception

unlock

public abstract void unlock(org.eclipse.higgins.icard.auth.IPinCodeCredential credential)
                     throws Exception
If the card is locked by PIN code, this method unlock the claim values and the master key.

Parameters:
credential -
Throws:
Exception

getType

public String getType()
Specified by:
getType in interface org.eclipse.higgins.icard.ICard
Overrides:
getType in class InformationCard