fi.hut.tcm.spki.format
Class CertData

java.lang.Object
  |
  +--fi.hut.tcm.spki.format.CertData

public class CertData
extends java.lang.Object

CertData Contains different certificate formats. May hold sequences of certificates as well as single ones. When several formats coexist, changing one means that others should be dropped or recreated.


Field Summary
private  java.util.Vector formats
           
 
Constructor Summary
CertData(Format first)
          Always at least one format.
 
Method Summary
 void addFormat(Format addThis)
          Adds new certificate formats.
 void addToSequence(SeqEnt entity)
          Adds a new entity at the end of a sequence.
 CertDisplay getCertDisplay()
           
 Comment getComment()
           
 Deleg getDeleg()
           
 Format getFormat(Format type)
          Returns the format that is of the same type than the argument.
 java.security.PublicKey getIssuer()
           
 java.net.URL[] getIssuerInfo()
           
 java.lang.Object getSubject()
           
 java.net.URL[] getSubjectInfo()
           
 Tag getTag()
           
 Validity getValidity()
           
 int getVersion()
          Returns the version number of the certificate type.
 boolean isSingleCert()
          Tests if GenericFormat is single certificate instead of a sequence.
 boolean isValid()
           
 java.util.Iterator iterator()
          Returns an iterator of the sequence entities.
 void makeCanonicalSpki()
          Makes Spki transfer representation.
 void parseCanonicalSpki()
          Parses Spki transfer representation.
 void putCertDisplay(CertDisplay certDisplay)
           
 void putComment(Comment comment)
           
 void putDeleg(Deleg deleg)
           
 void putIssuer(java.security.PublicKey issuer)
           
 void putIssuerInfo(java.net.URL[] urls)
           
 void putSubject(java.lang.Object subject)
           
 void putSubjectInfo(java.net.URL[] urls)
           
 void putTag(Tag tag)
           
 void putValidity(Validity valid)
           
 void reduceSequence()
          Reduces a sequence to a single certificate.
 void removeFormat(Format type)
          Removes the format that is of the same type than the argument.
 void removeSequenceEntity(SeqEnt removeThis)
          Removes an entity from a sequence.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

formats

private java.util.Vector formats
Constructor Detail

CertData

public CertData(Format first)
Always at least one format.
Method Detail

addFormat

public void addFormat(Format addThis)
Adds new certificate formats. It is the responsibility to assure that the formats are consistent with each other. If this kind of format already exists, the new format replaces the old one.

getFormat

public Format getFormat(Format type)
Returns the format that is of the same type than the argument. If not found, null is returned. Returns GenericFormat if the argument is either of it's possible subclasses.

removeFormat

public void removeFormat(Format type)
                  throws java.lang.IllegalArgumentException
Removes the format that is of the same type than the argument. Throws the exception if such format was not found.

isValid

public boolean isValid()

parseCanonicalSpki

public void parseCanonicalSpki()
                        throws java.lang.NoSuchFieldException,
                               java.lang.IllegalArgumentException
Parses Spki transfer representation. Throws NoSuchFieldException if CanonicalSpki is not among the formats and IllegalArgumentException if CanonicalSpki parsing fails.

makeCanonicalSpki

public void makeCanonicalSpki()
                       throws java.lang.NoSuchFieldException,
                              java.lang.IllegalArgumentException
Makes Spki transfer representation. Throws NoSuchFieldException if GenericFormat does not exist and IllegalArgumentException if GenericFormat was bad.

isSingleCert

public boolean isSingleCert()
                     throws java.lang.NoSuchMethodException
Tests if GenericFormat is single certificate instead of a sequence. Throws the exception if GenericFormat does not exist.

reduceSequence

public void reduceSequence()
                    throws java.lang.NoSuchMethodException
Reduces a sequence to a single certificate. Throws NoSuchMethodException if GenericFormat does not exist.

addToSequence

public void addToSequence(SeqEnt entity)
                   throws java.lang.NoSuchMethodException
Adds a new entity at the end of a sequence. Throws the exception if GenericFormat is a single certificate.

iterator

public java.util.Iterator iterator()
                            throws java.lang.NoSuchMethodException
Returns an iterator of the sequence entities. Throws the exception if GenericFormat is a single certificate.

removeSequenceEntity

public void removeSequenceEntity(SeqEnt removeThis)
                          throws java.lang.NoSuchFieldException,
                                 java.lang.NoSuchMethodException
Removes an entity from a sequence. Throws NoSuchMethodException if GenericFormat is a single certificate and NoSuchFieldException if this entity does not exist in a sequence.

getVersion

public int getVersion()
Returns the version number of the certificate type. At the moment this is always 0.

putCertDisplay

public void putCertDisplay(CertDisplay certDisplay)
                    throws java.lang.IllegalStateException,
                           java.lang.NoSuchMethodException

getCertDisplay

public CertDisplay getCertDisplay()
                           throws java.lang.IllegalStateException,
                                  java.lang.NoSuchMethodException

putIssuer

public void putIssuer(java.security.PublicKey issuer)
               throws java.lang.IllegalStateException,
                      java.lang.NoSuchMethodException

getIssuer

public java.security.PublicKey getIssuer()
                                  throws java.lang.NoSuchFieldException,
                                         java.lang.NoSuchMethodException

putIssuerInfo

public void putIssuerInfo(java.net.URL[] urls)
                   throws java.lang.NoSuchFieldException,
                          java.lang.NoSuchMethodException

getIssuerInfo

public java.net.URL[] getIssuerInfo()
                             throws java.lang.NoSuchFieldException,
                                    java.lang.NoSuchMethodException

putSubject

public void putSubject(java.lang.Object subject)
                throws java.lang.IllegalStateException,
                       java.lang.NoSuchMethodException

getSubject

public java.lang.Object getSubject()
                            throws java.lang.NoSuchFieldException,
                                   java.lang.NoSuchMethodException

putSubjectInfo

public void putSubjectInfo(java.net.URL[] urls)
                    throws java.lang.NoSuchFieldException,
                           java.lang.NoSuchMethodException

getSubjectInfo

public java.net.URL[] getSubjectInfo()
                              throws java.lang.NoSuchFieldException,
                                     java.lang.NoSuchMethodException

putDeleg

public void putDeleg(Deleg deleg)
              throws java.lang.IllegalStateException,
                     java.lang.NoSuchMethodException

getDeleg

public Deleg getDeleg()
               throws java.lang.NoSuchFieldException,
                      java.lang.NoSuchMethodException

putValidity

public void putValidity(Validity valid)
                 throws java.lang.IllegalStateException,
                        java.lang.NoSuchMethodException

getValidity

public Validity getValidity()
                     throws java.lang.NoSuchFieldException,
                            java.lang.NoSuchMethodException

putTag

public void putTag(Tag tag)
            throws java.lang.IllegalStateException,
                   java.lang.NoSuchMethodException

getTag

public Tag getTag()
           throws java.lang.NoSuchFieldException,
                  java.lang.NoSuchMethodException

putComment

public void putComment(Comment comment)
                throws java.lang.IllegalStateException,
                       java.lang.NoSuchMethodException

getComment

public Comment getComment()
                   throws java.lang.NoSuchFieldException,
                          java.lang.NoSuchMethodException