spki
Class NameCert

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

public class NameCert
extends CertBody

spki NameCert class.

Formal definitions:

 <name-cert>:: "(" "name-cert" <version>? <cert-display>? <issuer> <subject-name> <relative-name> <valid>
 <escrow>? <created>? <comment>? ")" ;
 

Version:
$Id: NameCert.java,v 1.10 2002/06/22 10:41:42 tep Exp $
Author:
Tep Narula <tep@win.trlabs.ca>

Field Summary
private static String __ME
          This class's full name.
private  RelativeName name
          The name field.
static String SEXP_NAME
          This class S-Expression type name, used by toSExpression() and other methods.
private  SubjectName subject
          The subject field.
private  Validity 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 NameCert()
          Don't use me!
  NameCert(Sexp cert_display, Issuer issuer, SubjectName subject, RelativeName name, Validity validity, Escrow escrow, Sexp comment)
          Create an immutable RoleCert object from given fields.
  NameCert(SExpression sexp)
          Create an immutable NameCert object from given S-Expression.
 
Method Summary
 LocalName getName()
          Get the name field.
 Subject getSubject()
          Get the subject field.
 Validity getValidity()
          Get the validity field.
 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, setCreated
 
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 SubjectName subject
The subject field.

validity

private Validity validity
The validity field.

name

private RelativeName name
The name field.
Constructor Detail

NameCert

protected NameCert()
            throws SPKIException
Don't use me!
See Also:
NameCert(SExpression), NameCert(Sexp,Issuer,SubjectName,RelativeName,Validity,Escrow,Sexp)

NameCert

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

NameCert

public NameCert(Sexp cert_display,
                Issuer issuer,
                SubjectName subject,
                RelativeName name,
                Validity validity,
                Escrow escrow,
                Sexp comment)
         throws SPKIException
Create an immutable RoleCert object from given fields.
Parameters:
cert_display - The optional display field, maybe null.
issuer - The issuer field.
subject - The subject field.
name - The name field.
validity - The validity 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)
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()
                   throws SPKIException
Get the subject field. If the subj-obj is a relative name, it'd create and return a new SubjectName object with a local name, anchored by the issuer's principal, as subj-obj. Otherwise, the subject field is return as is.
Overrides:
getSubject in class CertBody
See Also:
SubjectName

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.

getName

public LocalName getName()
                  throws SPKIException
Get the name field. It builds a LocalName object from the issuer's principal and the name field to represent the issuer's local name.
Returns:
a LocalName object.
Throws:
SPKIException - if something went wrong.