Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## spki
Class CertBody

    java.lang.Object
      |
      +--spki.BaseObj
            |
            +--spki.CertBody

Direct Known Subclasses:
  AttributeCert, CapabilityCert, NameCert, RoleCert, TransferCert

public abstract class CertBody
extends BaseObj
implements SeqEntry

spki CertBody class.

Formal definitions:

     <version>:: "(" "version" <byte-string> ")" ;
     <cert-display>:: "(" "display" <byte-string> ")" ;
     <issuer-loc>:: "(" "issuer-info" <loc-obj>+ ")" ;
     <subject-loc>:: "(" "subject-info" <loc-obj>+ ")" ;
     <created>:: "(" "created" <date> ")" ;
     <comment>:: "(" "comment" <byte-string> ")" ;

     <auth-cert>:: <role-cert> | <capability-cert> ;
     <cert-body>:: <auth-cert> | <name-cert> | <transfer-cert> | <attr-cert> ;

Version:
  $Id: CertBody.java,v 1.21 2002/07/22 11:30:19 tep Exp $
Author:
  Tep Narula <tep@win.trlabs.ca>
See Also:
  `RoleCert`, `CapabilityCert`, `NameCert`, `TransferCert`, `AttributeCert`, `LocObj`, `Date`, `Certificate`

Field Summary
`private static String` | `__ME` This class's full name.
`private Sexp` | `cert_display` The optional display field, maybe `null`.
`static String` | `CERT_DISPLAY_SEXP_NAME` The display field S-Expression type name.
`private Sexp` | `comment` The optional comment field, maybe `null`.
`static String` | `COMMENT_SEXP_NAME` The comment field S-Expression type name.
`private Date` | `created` The optional creation-date field, maybe `null`.
`static String` | `CREATED_SEXP_NAME` The creation-date field S-Expression type name.
`private Escrow` | `escrow` The optional escrow field, maybe `null`.
`private Issuer` | `issuer` The issuer field.
`private LocObj[]` | `issuer_loc` The optional isssuer-info field, maybe `null`.
`static String` | `ISSUER_LOC_SEXP_NAME` The issuer-info field S-Expression type name.
`static String` | `SEXP_NAME` This class S-Expression type name, used by toSExpression() and other methods.
`private LocObj[]` | `subject_loc` The optional subject-info field, maybe `null`.
`static String` | `SUBJECT_LOC_SEXP_NAME` The subject-info field S-Expression type name.
`private SList` | `version` The version field.
`static String` | `VERSION` The actual version string for this implementation (1.0a).
`static String` | `VERSION_SEXP_NAME` The version field S-Expression type name.

Fields inherited from class spki.BaseObj
`__ME, cache_sexp, cached_sexp, DEFAULT_HASH_ALG, locked, SEXP_NAME`

Constructor Summary
`protected` | `CertBody()` Don't use me.
`protected` | `CertBody(Sexp cert_display, Issuer issuer, LocObj[] issuer_loc, LocObj[] subject_loc, Escrow escrow, Sexp comment)` Create a partial CertBody object from given fields.
`protected` | `CertBody(SExpression sexp)` Create a partial CertBody object from given S-Expression.

Method Summary
`(package private) SExpression` | `buildCertDisplaySExpression()` Convert the display field into S-Expression, for use by subclass' toSExpression() method.
`(package private) SExpression` | `buildCommentSExpression()` Convert the comment field into S-Expression, for use by subclass' toSExpression() method.
`(package private) SExpression` | `buildCreatedSExpression()` Convert the created field into S-Expression, for use by subclass' toSExpression() method.
`(package private) SExpression` | `buildIssuerLocSExpression()` Convert the issuer-info field into S-Expression, for use by subclass' toSExpression() method.
`(package private) SExpression` | `buildSubjectLocSExpression()` Convert the subject-info field into S-Expression, for use by subclass' toSExpression() method.
`(package private) SExpression` | `buildVersionSExpression()` Convert the version field into S-Expression, for use by subclass' toSExpression() method.
`Sexp` | `getCertDisplay()` Get the display field, if available.
`Sexp` | `getComment()` Get the comment field, if available.
`Date` | `getCreated()` Get the created field, if available.
`Escrow` | `getEscrow()` Get the escrow field, if available.
`static CertBody` | `getInstance(SExpression sexp)` Get an instance of a certificate body from given S-Expression.
`Issuer` | `getIssuer()` Get the issuer field.
`LocObj` | `getIssuerLoc(int index)` Get the element at the specified index of the issuer-info field, if available.
`int` | `getIssuerLocLength()` Get the number of elements in the issuer-info field.
`abstract Subject` | `getSubject()` Get the subject field.
`LocObj` | `getSubjectLoc(int index)` Get the element at the specified index of the subject-info field, if available.
`int` | `getSubjectLocLength()` Get the number of elements in the subject-info field.
`abstract Validity` | `getValidity()` Get the validity field.
`static boolean` | `isCertBody(SExpression sexp)` Check an SExpression to see if it could contain a cert-body.
`void` | `setCreated()` Set the created time to the current time, to be called just before signing the certificate.

Methods inherited from class spki.BaseObj
`disableSExpressionCaching, enableSExpressionCaching, extractHashAlgId, getCachedSExpression, isLocked, isSListOfType, lock, providerToSPKI, setCachedSExpression, spkiToProvider, toSExpression, toString`

Methods inherited from class java.lang.Object
`, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait`

Field Detail

### __ME

    private static final String __ME

  This class's full name.

### SEXP_NAME

    public static final String SEXP_NAME

  This class S-Expression type name, used by toSExpression() and other methods. To be overridden by all subclasses.
  See Also:
    `BaseObj.toSExpression()`

### VERSION_SEXP_NAME

    public static final String VERSION_SEXP_NAME

  The version field S-Expression type name.

### VERSION

    public static final String VERSION

  The actual version string for this implementation (1.0a).

### version

    private SList version

  The version field.

### CERT_DISPLAY_SEXP_NAME

    public static final String CERT_DISPLAY_SEXP_NAME

  The display field S-Expression type name.

### cert_display

    private Sexp cert_display

  The optional display field, maybe `null`.

### ISSUER_LOC_SEXP_NAME

    public static final String ISSUER_LOC_SEXP_NAME

  The issuer-info field S-Expression type name.

### issuer_loc

    private LocObj[] issuer_loc

  The optional isssuer-info field, maybe `null`.

### issuer

    private Issuer issuer

  The issuer field.

### SUBJECT_LOC_SEXP_NAME

    public static final String SUBJECT_LOC_SEXP_NAME

  The subject-info field S-Expression type name.

### subject_loc

    private LocObj[] subject_loc

  The optional subject-info field, maybe `null`.

### escrow

    private Escrow escrow

  The optional escrow field, maybe `null`.

### CREATED_SEXP_NAME

    public static final String CREATED_SEXP_NAME

  The creation-date field S-Expression type name.

### created

    private Date created

  The optional creation-date field, maybe `null`.

### COMMENT_SEXP_NAME

    public static final String COMMENT_SEXP_NAME

  The comment field S-Expression type name.

### comment

    private Sexp comment

  The optional comment field, maybe `null`.

Constructor Detail

### CertBody

    protected CertBody()
                throws SPKIException

  Don't use me. To be called by each subclass' equivalent constructor.
  See Also:
    `CertBody(SExpression)`, `CertBody(Sexp,Issuer,LocObj[],LocObj[],Escrow,Sexp)`

### CertBody

    protected CertBody(SExpression sexp)
                throws ParseException,
                       SPKIException

  Create a partial CertBody object from given S-Expression. To be called by subclass' equivalent constructor. It parses given S-Expression, verifies the version string, and store all fields it recognizes except the subject and validity field. If all went well, the subclass' constructor should then continue by performing any additional verifications it may needs, parsing and storing the subject and validity field and any additional field(s) it may defines, and finally making the object immutable by calling the the lock() method.

### CertBody

    protected CertBody(Sexp cert_display,
                       Issuer issuer,
                       LocObj[] issuer_loc,
                       LocObj[] subject_loc,
                       Escrow escrow,
                       Sexp comment)
                throws SPKIException

  Create a partial CertBody object from given fields. To be called by each subclass' equivalent constructor. NOTE: This constructor doesn't call the lock() method; that is a job of the overriding constructor!
  Parameters:
    `cert_display` - The optional display field, maybe `null`.
    `issuer` - The issuer field.
    `issuer_loc` - The optional issuer-info, maybe `null`.
    `subject_loc` - The optional subject-info field, maybe `null`.
    `escrow` - The optional escrow field, maybe `null`.
    `comment` - The optional comment field, maybe `null`.
  Throws:
    SPKIException - if something went wrong.
  See Also:
    `setCreated()`

Method Detail

### getCertDisplay

    public Sexp getCertDisplay()
                        throws SPKIException

  Get the display field, if available. It returns a fresh copy of the field to prevent external tampering.
  Returns:
    an Sexp object containing the display field, or `null`
  Throws:
    SPKIException - if something went wrong.

### getIssuerLocLength

    public int getIssuerLocLength()

  Get the number of elements in the issuer-info field.
  Returns:
    an integer value of the number of elements, or 0.

### getIssuerLoc

    public LocObj getIssuerLoc(int index)

  Get the element at the specified index of the issuer-info field, if available.
  Parameters:
    `index` - index of the element required.
  Returns:
    a LocObj of the specified index, or `null` if index is out of bound or the field is empty.

### getSubjectLocLength

    public int getSubjectLocLength()

  Get the number of elements in the subject-info field.
  Returns:
    an integer value of the number of elements, or 0.

### getSubjectLoc

    public LocObj getSubjectLoc(int index)

  Get the element at the specified index of the subject-info field, if available.
  Parameters:
    `index` - index of the element required.
  Returns:
    a LocObj of the specified index, or `null` if index is out of bound or the field is empty.

### getIssuer

    public Issuer getIssuer()

  Get the issuer field.
  Returns:
    an Issuer object.

### getSubject

    public abstract Subject getSubject()
                                throws SPKIException

  Get the subject field.
  Returns:
    a Subject object.
  Throws:
    SPKIException - if something went wrong.

### getEscrow

    public Escrow getEscrow()

  Get the escrow field, if available.
  Returns:
    an Escrow object, or `null`.

### getCreated

    public Date getCreated()

  Get the created field, if available.
  Returns:
    a Date object containing the creation date, or `null`.

### getValidity

    public abstract Validity getValidity()

  Get the validity field.
  Returns:
    a Validity object.

### getComment

    public Sexp getComment()
                    throws SPKIException

  Get the comment field, if available. It returns a fresh copy of the field to prevent external tampering.
  Returns:
    an Sexp object containing the comment, or `null`.

### setCreated

    public void setCreated()
                    throws IllegalStateException,
                           SPKIException

  Set the created time to the current time, to be called just before signing the certificate. This method may be called only once. NOTE: If any of the validity fields's not-before, maybe-after and not-after time is present, the calller is responsible for ensuring that the created < not-before < maybe-after < not-after relation holds.
  Throws:
    IllegalStateException - if the created field already exists.
    SPKIException - if something went wrong.

### getInstance

    public static final CertBody getInstance(SExpression sexp)
                                      throws ParseException,
                                             SPKIException

  Get an instance of a certificate body from given S-Expression.
  Parameters:
    `sexp` - the SExpression containing a certificate body.
  Returns:
    An instance of CertBody.
  Throws:
    ParseException - if the argument doesn't contain a certificate body.
    SPKIException - if something went wrong.

### isCertBody

    public static final boolean isCertBody(SExpression sexp)

  Check an SExpression to see if it could contain a cert-body. It's a convenient utility function that checks whether the given SExpressions is an SList whose type-name ends with `-cert'.
  Returns:
    `true` if given SExpression could contain be a cert-body, `false` otherwise.

### buildVersionSExpression

    SExpression buildVersionSExpression()
                                  throws SPKIException

  Convert the version field into S-Expression, for use by subclass' toSExpression() method.
  Returns:
    SExpression object contaning the version field.
  Throws:
    SPKIException - if something went wrong.

### buildCertDisplaySExpression

    SExpression buildCertDisplaySExpression()
                                      throws SPKIException

  Convert the display field into S-Expression, for use by subclass' toSExpression() method.
  Returns:
    SExpression object contaning the display field.
  Throws:
    SPKIException - if something went wrong.

### buildCreatedSExpression

    SExpression buildCreatedSExpression()
                                  throws SPKIException

  Convert the created field into S-Expression, for use by subclass' toSExpression() method.
  Returns:
    SExpression object contaning the created field.
  Throws:
    SPKIException - if something went wrong.

### buildCommentSExpression

    SExpression buildCommentSExpression()
                                  throws SPKIException

  Convert the comment field into S-Expression, for use by subclass' toSExpression() method.
  Returns:
    SExpression object contaning the comment field.
  Throws:
    SPKIException - if something went wrong.

### buildIssuerLocSExpression

    SExpression buildIssuerLocSExpression()
                                    throws SPKIException

  Convert the issuer-info field into S-Expression, for use by subclass' toSExpression() method.
  Returns:
    SExpression object contaning the issuer-info field.
  Throws:
    SPKIException - if something went wrong.

### buildSubjectLocSExpression

    SExpression buildSubjectLocSExpression()
                                     throws SPKIException

  Convert the subject-info field into S-Expression, for use by subclass' toSExpression() method.
  Returns:
    SExpression object contaning the subject-info field.
  Throws:
    SPKIException - if something went wrong.

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD