spki
Class TransferCert

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

public class TransferCert
extends CertBody

spki TransferCert class.

Formal definitions:

 <transfer-cert>:: "(" "transfer-cert" <version>? <cert-display>? <issuer> <issuer-loc>? <subject-transfer>
 <valid-transfer> <escrow>? <comment>? ")" ;
 

Version:
$Id: TransferCert.java,v 1.9 2002/05/06 07:06:05 tep Exp $
Author:
Tep Narula <tep@win.trlabs.ca>
See Also:
Issuer, LocObj, SubjectTransfer, ValidTransfer, Escrow

Field Summary
private static String __ME
          This class's full name.
private  boolean dirty
          Do we need to re-build the SExpression?
static String SEXP_NAME
          This class S-Expression type name, used by toSExpression() and other methods.
private  SubjectTransfer subject
          The subject field.
private  ValidTransfer validity
          The validity field.
 
Fields inherited from class spki.CertBody
__ME, cert_display, CERT_DISPLAY_SEXP_NAME, comment, COMMENT_SEXP_NAME, created, CREATED_SEXP_NAME, escrow, issuer, issuer_loc, ISSUER_LOC_SEXP_NAME, SEXP_NAME, subject_loc, SUBJECT_LOC_SEXP_NAME, version, VERSION, VERSION_SEXP_NAME
 
Fields inherited from class spki.BaseObj
__ME, cache_sexp, cached_sexp, DEFAULT_HASH_ALG, locked, SEXP_NAME
 
Constructor Summary
protected TransferCert()
          Don't use me!
  TransferCert(Sexp cert_display, Issuer issuer, LocObj[] issuer_loc, SubjectTransfer subject, Escrow escrow, Sexp comment)
          Create an immutable TransferCert object from given fields.
  TransferCert(SExpression sexp)
          Create an immutable TransferCert object from given S-Expression.
 
Method Summary
 Subject getSubject()
          Get the subject field.
 Validity getValidity()
          Get the validity field.
 void setCreated()
          Create the validity field with the not-before date set to the current time, to be called just before signing the certificate.
 SExpression toSExpression()
          Build an SExpression representing this object.
 
Methods inherited from class spki.CertBody
buildCertDisplaySExpression, buildCommentSExpression, buildCreatedSExpression, buildIssuerLocSExpression, buildSubjectLocSExpression, buildVersionSExpression, getCertDisplay, getComment, getCreated, getEscrow, getInstance, getIssuer, getIssuerLoc, getIssuerLocLength, getSubjectLoc, getSubjectLocLength, isCertBody
 
Methods inherited from class spki.BaseObj
disableSExpressionCaching, enableSExpressionCaching, extractHashAlgId, getCachedSExpression, isLocked, isSListOfType, lock, providerToSPKI, setCachedSExpression, spkiToProvider, 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.
See Also:
toSExpression()

subject

private SubjectTransfer subject
The subject field.

validity

private ValidTransfer validity
The validity field.

dirty

private boolean dirty
Do we need to re-build the SExpression?
See Also:
setCreated(), toSExpression()
Constructor Detail

TransferCert

protected TransferCert()
                throws SPKIException
Don't use me!
See Also:
TransferCert(SExpression), TransferCert(Sexp,Issuer,LocObj[],SubjectTransfer,Escrow,Sexp)

TransferCert

public TransferCert(SExpression sexp)
             throws ParseException,
                    SPKIException
Create an immutable TransferCert object from given S-Expression.
See Also:
CertBody.CertBody(SExpression)

TransferCert

public TransferCert(Sexp cert_display,
                    Issuer issuer,
                    LocObj[] issuer_loc,
                    SubjectTransfer subject,
                    Escrow escrow,
                    Sexp comment)
             throws SPKIException
Create an immutable TransferCert object from given fields. NOTE: Since transfer certificate validity field's not-before date is always the same as its creation date, the validity field won't be created until the setCreated() method is called just before signing the certificate.
Parameters:
cert_display - The optional display field, maybe null.
issuer - The issuer field.
issuer_loc - The optional issuer-info, maybe null.
subject - The subject field.
escrow - The optional escrow field, maybe null.
comment - The optional comment field, maybe null.
Throws:
SPKIException - if something went wrong.
See Also:
CertBody.CertBody(Sexp,Issuer,LocObj[],LocObj[],Escrow,Sexp), setCreated()
Method Detail

toSExpression

public SExpression toSExpression()
                          throws SPKIException
Description copied from interface: SPKIObject
Build an SExpression representing this object.
Overrides:
toSExpression in class BaseObj
Tags copied from interface: SPKIObject
Returns:
SExpression object representing this object, or null.
Throws:
SPKIException - if something went wrong during conversion.

getSubject

public Subject getSubject()
Description copied from class: CertBody
Get the subject field.
Overrides:
getSubject in class CertBody
Tags copied from class: CertBody
Returns:
a Subject object.
Throws:
SPKIException - if something went wrong.

getValidity

public Validity getValidity()
Description copied from class: CertBody
Get the validity field.
Overrides:
getValidity in class CertBody
Tags copied from class: CertBody
Returns:
a Validity object.

setCreated

public void setCreated()
                throws IllegalStateException,
                       SPKIException
Create the validity field with the not-before date set to the current time, to be called just before signing the certificate. This is because transfer certificate always has the not-before date set to its creation time. This method may be called only once. NOTE: unlike other types of certificates, calling this method before signing the certificate is not optional but mandatory.
Overrides:
setCreated in class CertBody
Throws:
IllegalStateException - if the validity field already exists.
SPKIException - if something went wrong.
See Also:
TransferCert(Sexp,Issuer,LocObj[],SubjectTransfer,Escrow,Sexp)