sdsi
Class Cert

java.lang.Object
  |
  +--sdsi.SDSIObject
        |
        +--sdsi.Cert
All Implemented Interfaces:
SequenceItem, java.io.Serializable
Direct Known Subclasses:
Auth, Def

public abstract class Cert
extends SDSIObject
implements SequenceItem

The basic class which represents certificates in SDSI/SPKI 2.0.

Author:
Alexander Morcos, Sameer Ajmani
See Also:
Auth, Def, SDSIObject, Serialized Form

Field Summary
(package private)  boolean certDisplayDefined
           
(package private)  boolean commentDefined
           
(package private)  boolean delegate
           
(package private)  SDSIPrincipal issuer
           
(package private)  Subject s
           
(package private)  Tag t
           
(package private)  Validity valid
           
(package private)  boolean versionDefined
           
 
Fields inherited from class sdsi.SDSIObject
_hash, _modified, srep
 
Constructor Summary
protected Cert(SDSIPrincipal issuer, Subject s, Tag t, boolean delegate, Validity valid)
          Initializes the variables in the Cert, does not set up the SexpList representation.
protected Cert(SexpList l)
          Initializes the variables in the Cert, including setting up the SexpList representation.
 
Method Summary
static Cert create(SexpList l)
          Creates a new Cert.
 SDSIPrincipal getIssuer()
          Returns the issuer of this Cert.
 Subject getSubject()
          Returns the subject of this Cert.
 Validity getValidity()
           
 boolean isReducing()
           
protected  void parseItem(SexpList list)
          Parses a sub-list within the S-expression, this routine is called by the sub-class constructors.
abstract  Cert reduce(Cert cert)
           
protected  Tag reducedTag(Tag otherTag)
           
protected  Validity reducedValidity(Validity otherValid)
           
abstract  boolean reduces(Cert cert)
           
 boolean sameAs(java.lang.Object object)
           
 boolean valid()
          Tests if the Cert is currently valid.
 
Methods inherited from class sdsi.SDSIObject
equals, getAbbreviation, getHash, getHash, getSrep, getType, hashCode, principalParse, readFrom, readFrom, sign, toReadableString, toShortString, toString, writeCanonical, writeReadable
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface sdsi.SequenceItem
getSrep
 

Field Detail

issuer

SDSIPrincipal issuer

s

Subject s

t

Tag t

delegate

boolean delegate

valid

Validity valid

versionDefined

boolean versionDefined

certDisplayDefined

boolean certDisplayDefined

commentDefined

boolean commentDefined
Constructor Detail

Cert

protected Cert(SDSIPrincipal issuer,
               Subject s,
               Tag t,
               boolean delegate,
               Validity valid)
Initializes the variables in the Cert, does not set up the SexpList representation. This constructor is only called by subclasses which also do additional setup work


Cert

protected Cert(SexpList l)
        throws SexpParseException
Initializes the variables in the Cert, including setting up the SexpList representation. Also checks that the list is really a cert. This constructor is only called by subclasses which also do additional setup work.

Throws:
SexpParseException - if the SexpList is not a correctly formatted SDSI certificate.
Method Detail

sameAs

public boolean sameAs(java.lang.Object object)
Overrides:
sameAs in class SDSIObject

create

public static Cert create(SexpList l)
                   throws SexpParseException
Creates a new Cert. Scans the SexpList to determine whether the Cert is a Authorization or a Name Definition and then it returns the newly created appropriate sub-class.

Parameters:
l - the SexpList that contains the certificate
Returns:
a Cert object that represents the certificate
Throws:
SexpParseException - if the SexpList is not a correctly formatted SDSI certificate

parseItem

protected void parseItem(SexpList list)
                  throws SexpParseException
Parses a sub-list within the S-expression, this routine is called by the sub-class constructors.

Throws:
SexpParseException - if the sub-list does not correctly specify part of a Cert

valid

public boolean valid()
Tests if the Cert is currently valid.

Returns:
true if the cert is valid now, false otherwise.

getIssuer

public SDSIPrincipal getIssuer()
Returns the issuer of this Cert.

Returns:
the SDSIPrincipal which is the issuer of this certificate.

getSubject

public Subject getSubject()
Returns the subject of this Cert. All SDSIObjects that can be subjects of certificates implement the Subject interface.

Returns:
the SDSIObject which is the subject of this certificate.

getValidity

public Validity getValidity()

reducedValidity

protected Validity reducedValidity(Validity otherValid)

reducedTag

protected Tag reducedTag(Tag otherTag)

isReducing

public boolean isReducing()

reduces

public abstract boolean reduces(Cert cert)

reduce

public abstract Cert reduce(Cert cert)